diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 966f8f23f340..9f3c72a177d2 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -902,13 +902,13 @@ export default async function getBaseWebpackConfig( isServer && isWebpack5 && !dev ? path.join(outputPath, 'chunks') : outputPath, - // On the server we don't use the chunkhash + // On the server we don't use hashes filename: isServer ? isWebpack5 && !dev ? '../[name].js' : '[name].js' : `static/chunks/${isDevFallback ? 'fallback/' : ''}[name]${ - dev ? '' : '-[chunkhash]' + dev ? '' : isWebpack5 ? '-[contenthash]' : '-[chunkhash]' }.js`, library: isServer ? undefined : '_N_E', libraryTarget: isServer ? 'commonjs2' : 'assign', @@ -1284,9 +1284,6 @@ export default async function getBaseWebpackConfig( webpackConfig.cache = cache - // @ts-ignore TODO: remove ignore when webpack 5 is stable - webpackConfig.optimization.realContentHash = false - if (process.env.NEXT_WEBPACK_LOGGING) { const logInfra = process.env.NEXT_WEBPACK_LOGGING.includes( 'infrastructure'