three.cad/webpack.prod.js

36 lines
828 B
JavaScript
Raw Normal View History

2021-03-20 19:08:15 +00:00
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
2021-04-19 07:30:29 +00:00
const webpack = require('webpack')
2021-04-23 06:34:44 +00:00
const TerserPlugin = require("terser-webpack-plugin");
2021-04-23 10:54:55 +00:00
const CopyPlugin = require("copy-webpack-plugin");
2021-03-20 19:08:15 +00:00
module.exports = merge(common, {
mode: 'production',
2021-04-19 07:30:29 +00:00
plugins: [
new webpack.DefinePlugin({
2021-04-19 07:36:06 +00:00
'process.env.NODE_ENV': JSON.stringify('production')
// 'process.env.NODE_ENV': 'production'
2021-04-19 07:30:29 +00:00
}),
2021-04-23 10:54:55 +00:00
new webpack.IgnorePlugin(/redux-logger/),
new CopyPlugin({
patterns: [
{ from: "static", to: "" },
],
}),
2021-04-23 06:34:44 +00:00
],
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
format: {
comments: false,
},
},
extractComments: false,
}),
],
}
2021-03-20 19:08:15 +00:00
});