1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Let webpack handle contenthash (#4895)

This commit is contained in:
Sayuti Daniel 2018-08-05 01:18:20 +07:00 committed by Tim Neutkens
parent b1459bfd60
commit 919b88509c

View file

@ -158,7 +158,7 @@ export default async function getBaseWebpackConfig (dir: string, {dev = false, i
filename: ({chunk}) => {
// 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.contentHash.javascript + '.js')
return chunk.name.replace(/\.js$/, '-[contenthash].js')
}
return '[name]'
},