Skip to content

Commit

Permalink
Use contenthash instead of chunkhash (#4894)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sayuti Daniel authored and timneutkens committed Aug 4, 2018
1 parent b492e67 commit bd3f65b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,17 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i
output: {
path: outputPath,
filename: ({chunk}) => {
// Use `[name]-[chunkhash].js` in production
// Use `[name]-[contenthash].js` in production
if (!dev && (chunk.name === CLIENT_STATIC_FILES_RUNTIME_MAIN || chunk.name === CLIENT_STATIC_FILES_RUNTIME_WEBPACK)) {
return chunk.name.replace(/\.js$/, '-' + chunk.renderedHash + '.js')
return chunk.name.replace(/\.js$/, '-' + chunk.contentHash.javascript + '.js')
}
return '[name]'
},
libraryTarget: 'commonjs2',
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]' : '[chunkhash]'}.js` : `static/chunks/${dev ? '[name]' : '[chunkhash]'}.js`,
chunkFilename: isServer ? `${dev ? '[name]' : '[contenthash]'}.js` : `static/chunks/${dev ? '[name]' : '[contenthash]'}.js`,
strictModuleExceptionHandling: true
},
performance: { hints: false },
Expand Down

0 comments on commit bd3f65b

Please sign in to comment.