diff --git a/package.json b/package.json index 1f1cc3a..51a3a78 100644 --- a/package.json +++ b/package.json @@ -43,5 +43,8 @@ "webpack-cli": "^4.7.0", "webpack-dev-server": "^3.11.2", "z-pagerouter": "^1.0.5" + }, + "dependencies": { + "css-minimizer-webpack-plugin": "^3.0.0" } } diff --git a/webpack.config.js b/webpack.config.js index de54231..bb3c1db 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,6 +2,8 @@ const path = require('path'); const webpack = require('webpack'); 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 HtmlWebpackPlugin = require('html-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(), + ], + }, }; \ No newline at end of file