Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit 89bd98d

Browse files
committed
🔧Use contenthash for assets
1 parent fc9d33e commit 89bd98d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

config/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ exports.LOADER = LOADER;
2727
exports.getName = function getName(chunkName, ext, hashName, DEV_MODE) {
2828
return (
2929
chunkName +
30-
(DEV_MODE ? '.' : '-[' + (hashName ? hashName : 'chunkhash') + ':9].') +
30+
(DEV_MODE ? '.' : '-[' + (hashName ? hashName : 'contenthash') + ':9].') +
3131
ext
3232
);
3333
};

config/webpack.config.prod.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const webpackConfig = webpackMerge(baseWebpackConfig, {
1818
output: {
1919
publicPath: config.getStaticAssetsEndpoint() + utils.getPublicPath(),
2020
filename: utils.getName('[name]', 'js', '', false),
21-
chunkFilename: '[name]-[chunkhash:9].chunk.js',
2221
},
2322
module: {
2423
rules: [
@@ -35,8 +34,7 @@ const webpackConfig = webpackMerge(baseWebpackConfig, {
3534
stats: { children: false, warnings: false },
3635
plugins: [
3736
new MiniCssExtractPlugin({
38-
filename: '[name]-[hash:9].css',
39-
chunkFilename: '[id]-[hash:9].css',
37+
filename: utils.getName('[name]', 'css', 'contenthash', false),
4038
}),
4139
new PreloadWebpackPlugin({
4240
rel: 'preload',

0 commit comments

Comments
 (0)