-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Scripts: Update webpack to v5 (try 2) #33818
Conversation
I fixed the Another issue will be solved by merging #33785 and rebasing. |
@gziolo What's the fastest way to reproduce this? |
@gziolo What's the fastest way to reproduce this? The steps I use to create a custom block: npx wp-create-block example --no-wp-scripts
cd example
../node_modules/.bin/wp-script build |
Thanks, now I have the |
I looked into updating to v5 when working on #33785. I belive |
If it is possible then it would be great and we could stop maintaining those two custom plugins. They were introduced only to deal with webpack's limitations. |
Created #33826 based on this branch that removed those plugins. Runs |
5b73112
to
797f4cd
Compare
The |
Size Change: -35.5 kB (-3%) Total Size: 1.03 MB
ℹ️ View Unchanged
|
797f4cd
to
54aaf83
Compare
'server-side-render', | ||
'shortcode', | ||
'warning', | ||
]; |
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 would be really nice if this information was part of the individual packages, like a flag in packages/api-fetch/package.json
. The list shoudn't be maintained in a build script.
It's certainly a task for another PR, it just caught my attention here and I wanted to make a note.
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.
I agree that it's a bit unfortunate that we have to list all of them. The benefit would be that we wouldn't have to maintain the same list in WordPress core. Still, it's a manual task that we will have to remember about.
All unit tests should be fixed with abbc15f. I marked In b257e9e, I added some tweaks to the default webpack config shipped with |
packages/readable-js-assets-webpack-plugin/test/fixtures/webpack.config.js
Show resolved
Hide resolved
b102916
to
2e50a68
Compare
I published a new version of npm i --save-dev @wordpress/scripts@next |
I see an error that needs to be resolved before the final release:
It looks like we need to provide the fallback path to the browserlist config with |
Fix is ready: #34112. |
Update webpack version to latest version https://www.npmjs.com/package/webpack. This aligns closer with how the Gutenberg plugin handles WordPress packages. Related update in Gutenberg from August 2021: WordPress/gutenberg#33818. Props walbo, desrosj, mukesh27. Fixes #51750. git-svn-id: https://develop.svn.wordpress.org/trunk@53135 602fd350-edb4-49c9-b593-d223f7449a82
Update webpack version to latest version https://www.npmjs.com/package/webpack. This aligns closer with how the Gutenberg plugin handles WordPress packages. Related update in Gutenberg from August 2021: WordPress/gutenberg#33818. Props walbo, desrosj, mukesh27. Fixes #51750. Built from https://develop.svn.wordpress.org/trunk@53135 git-svn-id: http://core.svn.wordpress.org/trunk@52724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Update webpack version to latest version https://www.npmjs.com/package/webpack. This aligns closer with how the Gutenberg plugin handles WordPress packages. Related update in Gutenberg from August 2021: WordPress/gutenberg#33818. Props walbo, desrosj, mukesh27. Fixes #51750. Built from https://develop.svn.wordpress.org/trunk@53135 git-svn-id: https://core.svn.wordpress.org/trunk@52724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Description
Follow-up for #26382.
Fixes #33768, fixes #32203, fixes #30289.
It's a second attempt to upgrade webpack to v5.
Known Issues
wp-scripts build
generates styles with a wrong nameit should be
index-style.css
in the context of a blocknpm run build
errors because of API changes in webpack pluginsnpm run storybook:build
– Storybook has to be updated to work with webpack v5, more details at https://storybook.js.org/blog/storybook-for-webpack-5/How has this been tested?
Build for Gutenberg
npm run dev
npm run build
Build for Storybook
npm run storybook:dev
npm run storybook:build
Build for
@wordpress/scripts
npx wp-create-block example --no-wp-scripts cd example ../node_modules/.bin/wp-script build
Types of changes
Breaking change for
@wordpress/scripts
users that provide their own config files for build tools.Checklist:
*.native.js
files for terms that need renaming or removal).