33 lines
763 B
JavaScript
33 lines
763 B
JavaScript
|
const merge = require("webpack-merge");
|
||
|
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
|
||
|
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
|
||
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||
|
|
||
|
const common = require("./webpack.common.js");
|
||
|
|
||
|
module.exports = merge(common, {
|
||
|
mode: "production",
|
||
|
|
||
|
output: {
|
||
|
filename: "[name].[hash:5].js",
|
||
|
chunkFilename: "[id].[hash:5].css"
|
||
|
},
|
||
|
|
||
|
optimization: {
|
||
|
minimizer: [
|
||
|
new UglifyJsPlugin({
|
||
|
cache: true,
|
||
|
parallel: true,
|
||
|
sourceMap: true
|
||
|
}),
|
||
|
|
||
|
new MiniCssExtractPlugin({
|
||
|
filename: "[name].[hash:5].css",
|
||
|
chunkFilename: "[id].[hash:5].css"
|
||
|
}),
|
||
|
|
||
|
new OptimizeCSSAssetsPlugin({})
|
||
|
]
|
||
|
}
|
||
|
});
|