diff options
Diffstat (limited to 'vnext/webpack.config.js')
-rw-r--r-- | vnext/webpack.config.js | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/vnext/webpack.config.js b/vnext/webpack.config.js index 3493184c..336f2d09 100644 --- a/vnext/webpack.config.js +++ b/vnext/webpack.config.js @@ -3,9 +3,10 @@ const path = require('path'); const HtmlWebPackPlugin = require('html-webpack-plugin'); 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 ErrorOverlayPlugin = require('error-overlay-webpack-plugin'); const ESLintPlugin = require('eslint-webpack-plugin'); +const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin'); module.exports = (env, argv) => { const dev = argv.mode !== 'production'; @@ -105,21 +106,14 @@ module.exports = (env, argv) => { if (dev) { config.plugins.push(new webpack.HotModuleReplacementPlugin()); + config.plugins.push(new ReactRefreshWebpackPlugin()); } else { config.optimization = { minimizer: [ - new TerserPlugin({ - cache: true, - parallel: true, - sourceMap: dev, - terserOptions: { - output: { - comments: /@license/i - } - }, - extractComments: true - }), - new OptimizeCSSAssetsPlugin({}) + '...', + new CssMinimizerPlugin({ + sourceMap: true + }) ], splitChunks: { chunks: 'all' |