diff options
Diffstat (limited to '')
-rw-r--r-- | html/webpack.config.js | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/html/webpack.config.js b/html/webpack.config.js index 0285d96..593bac3 100644 --- a/html/webpack.config.js +++ b/html/webpack.config.js @@ -3,7 +3,7 @@ const { merge } = require('webpack-merge'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); -const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); +const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin'); const devMode = process.env.NODE_ENV !== 'production'; @@ -15,7 +15,7 @@ const baseConfig = { }, output: { path: path.resolve(__dirname, 'dist'), - filename: devMode ? '[name].js' : '[name].[hash].js', + filename: devMode ? '[name].js' : '[name].[contenthash].js', }, module: { rules: [ @@ -49,8 +49,8 @@ const baseConfig = { ], }), new MiniCssExtractPlugin({ - filename: devMode ? '[name].css' : '[name].[hash].css', - chunkFilename: devMode ? '[id].css' : '[id].[hash].css', + filename: devMode ? '[name].css' : '[name].[contenthash].css', + chunkFilename: devMode ? '[id].css' : '[id].[contenthash].css', }), new HtmlWebpackPlugin({ inject: false, @@ -86,17 +86,8 @@ const prodConfig = { mode: 'production', optimization: { minimizer: [ - new TerserPlugin({ - sourceMap: true - }), - new OptimizeCSSAssetsPlugin({ - cssProcessorOptions: { - map: { - inline: false, - annotation: true - } - } - }), + new TerserPlugin(), + new CssMinimizerPlugin(), ] }, devtool: 'source-map', |