Skip to content
This repository was archived by the owner on Oct 31, 2020. It is now read-only.

Commit 77c1dd2

Browse files
committed
improve hash stability
1 parent 058509d commit 77c1dd2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

webpack.config.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ module.exports = (env = {}) => {
116116
template: './index.html',
117117
favicon: './favicon.ico'
118118
}),
119+
new webpack.NamedModulesPlugin(),
120+
new webpack.NamedChunksPlugin((chunk) => {
121+
if (chunk.name) return chunk.name
122+
return chunk.mapModules(m => path.relative(m.context, m.request)).join('_')
123+
}),
119124
// Dev plugins
120125
...(isDev ? [
121126
new webpack.DefinePlugin({
@@ -131,12 +136,12 @@ module.exports = (env = {}) => {
131136
}),
132137
new webpack.HotModuleReplacementPlugin({
133138
// multiStep: true, // better performance with many files
134-
}),
135-
new webpack.NamedModulesPlugin()
139+
})
136140
] : []),
137141
// Build plugins
138142
...(isBuild ? [
139143
new CleanWebpackPlugin([PATHS.dist]),
144+
new webpack.HashedModuleIdsPlugin(),
140145
new webpack.DefinePlugin({
141146
'process.env': {
142147
NODE_ENV: JSON.stringify('production')

0 commit comments

Comments
 (0)