Skip to content

Commit

Permalink
🔧Use contenthash for assets
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonBoy committed Jun 25, 2019
1 parent fc9d33e commit 89bd98d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exports.LOADER = LOADER;
exports.getName = function getName(chunkName, ext, hashName, DEV_MODE) {
return (
chunkName +
(DEV_MODE ? '.' : '-[' + (hashName ? hashName : 'chunkhash') + ':9].') +
(DEV_MODE ? '.' : '-[' + (hashName ? hashName : 'contenthash') + ':9].') +
ext
);
};
Expand Down
4 changes: 1 addition & 3 deletions config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const webpackConfig = webpackMerge(baseWebpackConfig, {
output: {
publicPath: config.getStaticAssetsEndpoint() + utils.getPublicPath(),
filename: utils.getName('[name]', 'js', '', false),
chunkFilename: '[name]-[chunkhash:9].chunk.js',
},
module: {
rules: [
Expand All @@ -35,8 +34,7 @@ const webpackConfig = webpackMerge(baseWebpackConfig, {
stats: { children: false, warnings: false },
plugins: [
new MiniCssExtractPlugin({
filename: '[name]-[hash:9].css',
chunkFilename: '[id]-[hash:9].css',
filename: utils.getName('[name]', 'css', 'contenthash', false),
}),
new PreloadWebpackPlugin({
rel: 'preload',
Expand Down

0 comments on commit 89bd98d

Please sign in to comment.