diff options
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/webpack.config.js b/webpack.config.js index 331ed338..c12c19d8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,6 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const TerserPlugin = require('terser-webpack-plugin'); -const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); +const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const ESLintPlugin = require('eslint-webpack-plugin'); module.exports = (env, argv) => { @@ -42,7 +42,10 @@ module.exports = (env, argv) => { use: [ dev ? 'style-loader' : MiniCssExtractPlugin.loader, { - loader: 'css-loader' + loader: 'css-loader', + options: { + sourceMap: dev + } }, { loader: 'postcss-loader', @@ -71,18 +74,10 @@ module.exports = (env, argv) => { if (!dev) { config.optimization = { minimizer: [ - new TerserPlugin({ - cache: true, - parallel: true, - sourceMap: dev, - terserOptions: { - output: { - comments: /@license/i - } - }, - extractComments: true - }), - new OptimizeCSSAssetsPlugin({}) + '...', + new CssMinimizerPlugin({ + sourceMap: true + }) ] }; } |