-
Notifications
You must be signed in to change notification settings - Fork 3k
Block Editor: Try using DependencyExtractionWebpackPlugin #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block Editor: Try using DependencyExtractionWebpackPlugin #102
Conversation
You'll want to delete these lines so the wordpress-develop/tools/webpack/packages.js Lines 110 to 124 in f8688bb
wordpress-develop/tools/webpack/packages.js Line 187 in f8688bb
|
@sirreal, thanks for pointers. It solved the issue 🎉 I had to include @omarreiss, we add a number of PHP files for each JS script. Is it fine to keep them next to distribution version of JS files as presented on the screenshot? The same structure is present in both |
The discussion should continue on WordPress Trac: https://core.trac.wordpress.org/ticket/48154. |
I updated the patch with the latest changes from the In addition, I switched the output format for asset files to JSON. It also looks like JSON is now required to run WordPress so we can take advantage of it: |
WORKING_DIR + 'wp-includes/js/' | ||
], | ||
assets: [ | ||
WORKING_DIR + 'wp-includes/js/**/*.asset.php' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the core trac image the php
assets are now stored in the /src/wp-includes/assets/dist
folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more complex than that.
This is where webpack generates those PHP assets, we move them to /src/wp-includes/assets/dist
or /build/wp-includes/assets/dist
depending where webpack operates. It's even more hard to follow when you take into account that npm run build:dev
operates in src
folder, but npm run build
uses build
folder ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name should probably be updated to webpack-generated-assets
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved with https://core.trac.wordpress.org/changeset/47035. |
Work in progress.
I'll move to Trac as soon as Travis turns green :)