You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Enable webpack 5 by default for all apps
Still provides a way to opt-out using `webpack5: false` in next.config.js. Also throws an error for `future.webpack5`.
* Update tests
* Update test to run on webpack 4 instead of webpack 5
* disable webpack5 for legacy tests
* Fix stats-config for webpack4
* update tests
* update size for webpack4 test
* move basic suite first
* update basic test
* Add logs
* remove outdated testFutureDependencies job
Co-authored-by: JJ Kasper <[email protected]>
Copy file name to clipboardexpand all lines: errors/webpack5.md
+11-9
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,17 @@
2
2
3
3
#### Why This Message Occurred
4
4
5
-
Next.js will soon adopt webpack 5 as the default for compilation. We've spent a lot of effort into ensuring the transition from webpack 4 to 5 will be as smooth as possible. For example Next.js now comes with both webpack 4 and 5 allowing you to adopt webpack 5 by adding a flag to your `next.config.js`:
5
+
Next.js has adopted webpack 5 as the default for compilation. We've spent a lot of effort into ensuring the transition from webpack 4 to 5 will be as smooth as possible. For example Next.js now comes with both webpack 4 and 5 allowing you to adopt webpack 5 by adding a flag to your `next.config.js`:
6
6
7
7
```js
8
8
module.exports= {
9
-
future: {
10
-
webpack5:true,
11
-
},
9
+
// Webpack 5 is enabled by default
10
+
// You can still use webpack 4 while upgrading to the latest version of Next.js by adding the "webpack5: false" flag
11
+
webpack5:false,
12
12
}
13
13
```
14
14
15
-
Adopting webpack 5 in your application has many benefits, notably:
15
+
Using webpack 5 in your application has many benefits, notably:
16
16
17
17
- Improved Disk Caching: `next build` is significantly faster on subsequent builds
18
18
- Improved Fast Refresh: Fast Refresh work is prioritized
@@ -22,11 +22,13 @@ Adopting webpack 5 in your application has many benefits, notably:
22
22
- Support for web workers using `new Worker(new URL("worker.js", import.meta.url))`
23
23
- Support for `exports`/`imports` field in `package.json`
24
24
25
-
In upcoming releases we'll gradually roll out webpack 5 to applications that are compatible with webpack 5:
25
+
In the past releases we have gradually rolled out webpack 5 to Next.js applications:
26
26
27
-
- In the next minor version we'll automatically opt-in applications without custom webpack configuration in `next.config.js`
28
-
- In the next minor version we'll automatically opt-in applications that do not have a `next.config.js`
29
-
- In the next major version we'll enable webpack 5 by default. You'll still be able to opt-out and use webpack 4 to help with backwards compatibility
27
+
- In Next.js 10.2 we automatically opted-in applications without custom webpack configuration in `next.config.js`
28
+
- In Next.js 10.2 we automatically opted-in applications that do not have a `next.config.js`
29
+
- In Next.js 11 webpack 5 was enabled by default for all applications. You can still opt-out and use webpack 4 to help with backwards compatibility using `webpack5: false` in `next.config.js`
30
+
31
+
In the next major version webpack 4 support will be removed.
0 commit comments