|
|
@ -2,6 +2,7 @@ const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
|
|
|
const webpack = require('webpack');
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
|
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
|
|
|
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
|
|
|
|
|
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
|
|
const nodeEnv = (process.env.NODE_ENV || 'development').trim();
|
|
|
|
const nodeEnv = (process.env.NODE_ENV || 'development').trim();
|
|
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line
|
|
|
|
// eslint-disable-next-line
|
|
|
@ -43,7 +44,7 @@ module.exports = {
|
|
|
|
publicPath: '',
|
|
|
|
publicPath: '',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
optimization: {
|
|
|
|
optimization: {
|
|
|
|
minimizer: __DEV__ ? [] : [new OptimizeCSSAssetsPlugin({})],
|
|
|
|
minimizer: __DEV__ ? [] : [new OptimizeCSSAssetsPlugin({}), new TerserPlugin()],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
rules: [
|
|
|
|