WordPress.org

Make WordPress Core

Opened 9 months ago

Last modified 3 months ago

#51750 new enhancement

Update webpack to version 5.x

Reported by: mukesh27 Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: needs-patch
Focuses: javascript Cc:

Description

Update webpack version to latest version https://www.npmjs.com/package/webpack

Change History (4)

#1 @desrosj
9 months ago

  • Focuses javascript added
  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from Update webpack versions for 5.6 to Update webpack to version 5.x
  • Type changed from defect (bug) to enhancement

Just a note that any update to Webpack needs to be a coordinated effort with the block editor team in the Gutenberg repository to ensure both spots use the same version.

It's also unlikely that this update will be as straightforward as changing the version number and updating as there are many breaking changes. A full breakdown of the changes in Webpack 5.x can be found here: https://webpack.js.org/blog/2020-10-10-webpack-5-release/. We should also look at the changes in 5.x and see if there are any new features that can be utilized.

I'm going to move this to Future Release because it's unlikely this will happen in time for 5.6.

#2 @desrosj
3 months ago

Related #43731.

#3 @gziolo
3 months ago

I wanted to cross-reference the first failed attempt to updated webpack in Gutenberg: https://github.com/WordPress/gutenberg/pull/26382

Gutenberg build was working correctly, but some tools like Storybook and @wordpress/scripts stopped working because of some compatibility issues. We should give it another try in the next weeks.

Just a note that any update to Webpack needs to be a coordinated effort with the block editor team in the Gutenberg repository to ensure both spots use the same version.

@desrosj, do you anticipate any issues if we would start using different versions of webpack? As far as I can tell, Jarda landed all necessary changes to make v4 and v5 compatible in separate PRs, including changes to @wordpress/dependency-extraction-webpack-plugin that Calypso uses already with webpack 5. If you look at the PR I shared the number of changes is fairly minimal.

#4 @desrosj
3 months ago

Related: #53192.

Note: See TracTickets for help on using tickets.