Skip to content

Commit 060eee4

Browse files
authored
Fix wdm contenthash issue
1 parent 6405fab commit 060eee4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

webpack.config.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ module.exports = {
1919
},
2020
output: {
2121
path: outPath,
22-
filename: 'bundle.js',
23-
chunkFilename: '[chunkhash].js'
22+
filename: isProduction ? '[contenthash].js' : '[hash].js',
23+
chunkFilename: isProduction ? '[name].[contenthash].js' : '[name].[hash].js'
2424
},
2525
target: 'web',
2626
resolve: {
@@ -101,7 +101,8 @@ module.exports = {
101101
vendors: {
102102
test: /[\\/]node_modules[\\/]/,
103103
chunks: 'all',
104-
priority: -10
104+
priority: -10,
105+
filename: isProduction ? 'vendor.[contenthash].js' : 'vendor.[hash].js'
105106
}
106107
}
107108
},
@@ -114,7 +115,7 @@ module.exports = {
114115
}),
115116
new WebpackCleanupPlugin(),
116117
new MiniCssExtractPlugin({
117-
filename: '[contenthash].css',
118+
filename: isProduction ? '[contenthash].css' : '[hash].css',
118119
disable: !isProduction
119120
}),
120121
new HtmlWebpackPlugin({

0 commit comments

Comments
 (0)