加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.prod.js 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
/* eslint-disable */
const path = require('path');
const webpack = require('webpack');
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const TerserPlugin = require('terser-webpack-plugin');
commonWebpackConfig = require('./webpack.config');
productionWebpackConfig = Object.assign(commonWebpackConfig, {
output: {
path: path.join(__dirname, 'build/app'),
filename: '[name].[contenthash].js',
publicPath: `${process.env.CDN_URL || ""}/static/`,
},
cache: true,
mode: "production",
devtool: 'source-map',
entry: ['./app/index'],
stats: "normal",
optimization: {
...commonWebpackConfig.optimization,
minimizer: [
new TerserPlugin({
terserOptions: {
ecma: undefined,
parse: {},
compress: {},
mangle: true, // Note `mangle.properties` is `false` by default.
module: false,
output: null,
toplevel: false,
nameCache: null,
ie8: false,
keep_classnames: undefined,
keep_fnames: true,
safari10: false,
},
}),
],
},
});
productionWebpackConfig.plugins = [
...productionWebpackConfig.plugins,
new WebpackManifestPlugin()
];
module.exports = productionWebpackConfig;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化