diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 1b1bdfa5a3b6e..8f9753d16796e 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -790,7 +790,19 @@ export default async function getBaseWebpackConfig( ignored: ['**/.git/**', '**/node_modules/**', '**/.next/**'], }, output: { - ...(isWebpack5 ? { environment: 5 } : {}), + ...(isWebpack5 + ? { + environment: { + arrowFunction: false, + bigIntLiteral: false, + const: false, + destructuring: false, + dynamicImport: false, + forOf: false, + module: false, + }, + } + : {}), path: outputPath, // On the server we don't use the chunkhash filename: isServer