diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index ab9784c07f91c..0aa226ee8aab1 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1144,7 +1144,9 @@ export default async function getBaseWebpackConfig( // However, Webpack's `resource-path` is relative to the app dir. // TODO: Either `sourceRoot` should be populated with the root and then we can use `[resource-path]` // or we need a way to resolve return `path.relative(sourceMapLocation, info.resourcePath)` - devtoolModuleFilenameTemplate: '[absolute-resource-path]', + devtoolModuleFilenameTemplate: dev + ? '[absolute-resource-path]' + : undefined, webassemblyModuleFilename: 'static/wasm/[modulehash].wasm', hashFunction: 'xxhash64', hashDigestLength: 16,