Skip to content
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

Update 5.mdx #5832

Merged
merged 1 commit into from
Jan 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/content/migrate/5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ contributors:
- chenxsan
- jamesgeorge007
- getsnoopy
- yevhen-logosha
---

This guide aims to help you migrating to webpack 5 when using webpack directly. If you are using a higher level tool to run webpack, please refer to the tool for migration instructions.
Expand All @@ -32,6 +33,7 @@ Webpack 5 requires at least Node.js 10.13.0 (LTS), so make sure you upgrade your
3. Upgrade all used Plugins and Loaders to the latest available version

Some Plugins and Loaders might have a beta version that has to be used in order to be compatible with webpack 5.
Make sure to read release notes of each individual plugin/loader when upgrading it, since latest version might only support webpack 5 and will fail in v4. In such case, it's recommended to update to the latest version that supports webpack 4.

### Make sure your build has no errors or warnings

Expand Down Expand Up @@ -92,6 +94,8 @@ Now let's upgrade webpack to version 5:

- Yarn: `yarn add webpack@latest`

If you were not able to upgrade some plugins/loaders to the latest in Upgrade webpack 4 and its plugins/loaders step, don't forget to upgrade them now.

### Clean up configuration

- Consider removing `optimization.moduleIds` and `optimization.chunkIds` from your webpack configuration. The defaults could be better, because they support long term caching in [`production mode`](/configuration/mode/#mode-production) and debugging in [`development` mode](/configuration/mode/#mode-development).
Expand Down