-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add support for webpack 5 in Nx 12.x #5892
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nrwl/nx-dev/BQGMzBFvdQZZ8gZHAMir6w6Ha3TY |
Nx Cloud ReportCI ran the following commands for commit 52bd8a3. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch Sent with 💌 from NxCloud. |
"chalk": "4.1.0", | ||
"copy-webpack-plugin": "6.0.3", |
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.
removed since it was never used
Is it possible to install this branch/version locally and test it out? |
@Pkearney2021 You can follow the publish to local registry guide here https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#publishing-to-a-local-registry |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Update: PR is good to merge now that Nx 12.5 is released. This and the docs will be part of Nx 12.6.
This PR will enable webpack 5 support for web/react, and node. This will allow us to test the implementation on different workspaces to make sure we address all the edge cases. Then in Nx 13 we will remove webpack 4 support completely.
User can opt-in to webpack 5 by installing those packages in their workspace.
e.g.
User can also force webpack 4 by setting
NX_FORCE_WEBPACK_4=true
as an environment variable.Notes
src/webpack
folder has been added to cypress, node, react, and web packages. This is a temporary solution that we will remove for Nx 13.node_modules
, arequire
shim is used to check if they exist. If they exist then use the user's webpack, otherwise use package dependencies as usual.TODO(jack)
comments in all the places we need to clean up.fork-ts-checker-webpack-plugin
no longer supports multi process and now optimizes for single process mode.TODOs
Will be performing verifications manually. The e2e tests will still test with webpack 4 (default), and we'll add a few new ones for webpack 5).
Add documentation for React and Node on upgrading to webpack 5(this PR is getting large, will do a follow-up PR for the docs)