Repository navigation
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.
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.
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 |
Are we going to remove the legacy plugins from the repo? We won't do any further releases of them, will we? If we did, it would be preferrable to keep the unit tests working. |
|
@gziolo There are also unit tests failing in the |
It adjusts handling for assets that changed in v5.
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 buildgenerates styles with a wrong nameit should be
index-style.cssin the context of a blocknpm run builderrors 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 devnpm run buildBuild for Storybook
npm run storybook:devnpm run storybook:buildBuild for
@wordpress/scriptsnpx wp-create-block example --no-wp-scripts cd example ../node_modules/.bin/wp-script buildTypes of changes
Breaking change for
@wordpress/scriptsusers that provide their own config files for build tools.Checklist:
*.native.jsfiles for terms that need renaming or removal).