Updating latest
This commit is contained in:
@@ -2,6 +2,11 @@ const webpack = require("webpack");
|
||||
const common = require("./webpack.common");
|
||||
const merge = require("webpack-merge");
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
const TerserPlugin = require("terser-webpack-plugin");
|
||||
const CssMinimizer = require("optimize-css-assets-webpack-plugin");
|
||||
const PurgeCssPlugin = require("purgecss-webpack-plugin");
|
||||
const glob = require("glob");
|
||||
const path = require("path")
|
||||
|
||||
module.exports = merge(common, {
|
||||
mode: "production",
|
||||
@@ -32,5 +37,17 @@ module.exports = merge(common, {
|
||||
sourceMap: true,
|
||||
}),
|
||||
new webpack.HashedModuleIdsPlugin(),
|
||||
new PurgeCssPlugin({
|
||||
paths: glob.sync(path.join(__dirname, "layouts") + "/**/*.html", {
|
||||
nodir: true,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({ extractComments: false }),
|
||||
new CssMinimizer(),
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user