Unverified Commit 4af5032e authored by Jens Meindertsma's avatar Jens Meindertsma Committed by GitHub

Fix Webpack 5 configuration for v5.0.0-beta.30 (#17038)

This PR fixes #17035. As described in the issue, there was a breaking change in `webpack@5.0.0-beta.30`: `output.ecmaVersion` was replaced by `output.environment`. This meant Next.js apps using this `webpack` version would break. This PR updates the relevant Webpack config.

I think this will break any apps that are still using `webpack@5.0.0-beta.29`, but I don't know whether that is a problem as this is a beta feature. If it is, I'd love it if someone could let me know how to detect beta versions in the code so I can make it backwards-compatible.
parent 4c363140
...@@ -790,7 +790,7 @@ export default async function getBaseWebpackConfig( ...@@ -790,7 +790,7 @@ export default async function getBaseWebpackConfig(
ignored: ['**/.git/**', '**/node_modules/**', '**/.next/**'], ignored: ['**/.git/**', '**/node_modules/**', '**/.next/**'],
}, },
output: { output: {
...(isWebpack5 ? { ecmaVersion: 5 } : {}), ...(isWebpack5 ? { environment: 5 } : {}),
path: outputPath, path: outputPath,
// On the server we don't use the chunkhash // On the server we don't use the chunkhash
filename: isServer filename: isServer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment