const baseConfig = require("./webpack.config.js");
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const { merge } = require("webpack-merge");

module.exports = merge(baseConfig({
    NODE_ENV: "production"
}), {
    plugins: [
        new CleanWebpackPlugin(),
        // 提取CSS样式文件
        new MiniCssExtractPlugin({
            filename: 'static/css/[name].[contenthash:8].css',
        })
    ],
    mode: 'production'
})