diff --git a/build/webpack.js b/build/webpack.js index d3611186..b2b4d7ab 100644 --- a/build/webpack.js +++ b/build/webpack.js @@ -181,7 +181,7 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i hotUpdateChunkFilename: 'static/webpack/[id].[hash].hot-update.js', hotUpdateMainFilename: 'static/webpack/[hash].hot-update.json', // This saves chunks with the name given via `import()` - chunkFilename: isServer ? `${dev ? '[name]' : '[contenthash]'}.js` : `static/chunks/${dev ? '[name]' : '[contenthash]'}.js`, + chunkFilename: isServer ? `${dev ? '[name]' : '[name].[contenthash]'}.js` : `static/chunks/${dev ? '[name]' : '[name].[contenthash]'}.js`, strictModuleExceptionHandling: true }, performance: { hints: false }, @@ -213,7 +213,7 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i // Precompile react / react-dom for development, speeding up webpack dev && !isServer && new AutoDllPlugin({ filename: '[name]_[hash].js', - path: './static/dll', + path: './static/development/dll', context: dir, entry: { dll: [ diff --git a/build/webpack/plugins/build-manifest-plugin.js b/build/webpack/plugins/build-manifest-plugin.js index e6ab06f5..2139b6c3 100644 --- a/build/webpack/plugins/build-manifest-plugin.js +++ b/build/webpack/plugins/build-manifest-plugin.js @@ -15,7 +15,7 @@ export default class BuildManifestPlugin { for (const filePath of Object.keys(compilation.assets)) { const path = filePath.replace(/\\/g, '/') - if (/^static\/dll\//.test(path)) { + if (/^static\/development\/dll\//.test(path)) { assetMap.devFiles.push(path) } } diff --git a/test/integration/basic/components/hello-chunkfilename.js b/test/integration/basic/components/hello-chunkfilename.js new file mode 100644 index 00000000..9b1412df --- /dev/null +++ b/test/integration/basic/components/hello-chunkfilename.js @@ -0,0 +1 @@ +export default () =>