Unverified Commit 1db87036 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Webpack Build: Use name-contenthash instead of name-chunkhash for dynamic imports (#80153)

Did a bit of digging into #78756. This is a test to see if anything breaks when changing the option given that it seems we already read the file paths correctly, just needed to check it later in asset processing hook.
parent 6eb235c4
......@@ -1281,7 +1281,7 @@ export default async function getBaseWebpackConfig(
? `[name].js`
: `../[name].js`
: `static/chunks/${isDevFallback ? 'fallback/' : ''}[name]${
dev ? '' : appDir ? '-[chunkhash]' : '-[contenthash]'
dev ? '' : '-[contenthash]'
}.js`,
library: isClient || isEdgeServer ? '_N_E' : undefined,
libraryTarget: isClient || isEdgeServer ? 'assign' : 'commonjs2',
......
......@@ -128,9 +128,6 @@ function getAppPathRequiredChunks(
}
// Get the actual chunk file names from the chunk file list.
// It's possible that the chunk is generated via `import()`, in
// that case the chunk file name will be '[name].[contenthash]'
// instead of '[name]-[chunkhash]'.
if (chunk.id != null) {
const chunkId = '' + chunk.id
chunk.files.forEach((file) => {
......@@ -229,7 +226,7 @@ export class ClientReferenceManifestPlugin {
name: PLUGIN_NAME,
// Have to be in the optimize stage to run after updating the CSS
// asset hash via extract mini css plugin.
stage: webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_HASH,
stage: webpack.Compilation.PROCESS_ASSETS_STAGE_ANALYSE,
},
() => this.createAsset(compilation, compiler.context)
)
......
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