Improve assets caching

This commit is contained in:
ErickSkrauch 2020-07-21 21:28:03 +03:00
parent 364b7f3c80
commit d25653dd7c
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E

View File

@ -47,7 +47,7 @@ const webpackConfig = {
output: {
path: outputPath,
publicPath: '/',
filename: '[name].js?[hash]',
filename: '[name].js?[chunkhash]',
},
resolve: {
@ -179,14 +179,14 @@ const webpackConfig = {
test: /\.(png|gif|jpg|svg)$/,
loader: 'file-loader',
query: {
name: 'assets/[name].[ext]?[hash]',
name: 'assets/[name].[ext]?[contenthash]',
},
},
{
test: /\.(woff|woff2|ttf)$/,
loader: 'file-loader',
query: {
name: 'assets/fonts/[name].[ext]?[hash]',
name: 'assets/fonts/[name].[ext]?[contenthash]',
},
},
{
@ -232,8 +232,7 @@ if (isProduction) {
webpackConfig.plugins.push(
new MiniCssExtractPlugin({
filename: '[name].css?[hash]',
chunkFilename: '[id].css?[hash]',
filename: '[name].css?[contenthash]',
}),
);
}