1
0
Fork 0

Compress CSS.

This commit is contained in:
Kitteh 2021-05-30 09:25:53 +01:00
parent 6bb672182a
commit f23758e100
2 changed files with 18 additions and 0 deletions

View file

@ -43,5 +43,8 @@
"webpack-cli": "^4.7.0", "webpack-cli": "^4.7.0",
"webpack-dev-server": "^3.11.2", "webpack-dev-server": "^3.11.2",
"z-pagerouter": "^1.0.5" "z-pagerouter": "^1.0.5"
},
"dependencies": {
"css-minimizer-webpack-plugin": "^3.0.0"
} }
} }

View file

@ -2,6 +2,8 @@ const path = require('path');
const webpack = require('webpack'); const webpack = require('webpack');
var os = require("os"); var os = require("os");
const TerserPlugin = require("terser-webpack-plugin");
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const { GitRevisionPlugin } = require('git-revision-webpack-plugin'); const { GitRevisionPlugin } = require('git-revision-webpack-plugin');
@ -93,4 +95,17 @@ module.exports = {
} }
], ],
}, },
optimization: {
minimize: true,
minimizer: [
`...`,
new TerserPlugin({
terserOptions: {
ecma: "2015"
}
}),
new CssMinimizerPlugin(),
],
},
}; };