diff options
author | Vitaly Takmazov | 2020-10-14 08:19:23 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2020-10-14 08:19:23 +0300 |
commit | ab397f8c1128e60676e846c1c4f95e51ab63678f (patch) | |
tree | d58edbd9c204da575ed415e7925adfdee92ceedb /webpack.config.js | |
parent | d87ae33ff481548804b597e7dd432f3d2938f847 (diff) |
css-minimizer-webpack-plugin
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 + }) ] }; } |