aboutsummaryrefslogtreecommitdiff
path: root/webpack.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/webpack.config.js b/webpack.config.js
index d362c06f..450adeeb 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,12 +1,11 @@
const ESLintPlugin = require('eslint-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
+const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')
-module.exports = () => {
- const node_env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development'
- const dev = node_env !== 'production'
+module.exports = (env, argv) => {
+ const dev = argv.mode !== 'production'
const config = {
- mode: node_env,
devtool: dev ? 'source-map' : false,
entry: {
'scripts': [
@@ -99,6 +98,7 @@ module.exports = () => {
// Link to options - https://swc.rs/docs/config-js-minify
terserOptions: {},
}),
+ new CssMinimizerPlugin()
]
}
return config