three.cad/webpack.prod.js

35 lines
797 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')
2021-04-19 07:30:29 +00:00
}),
2021-04-23 10:54:55 +00:00
new webpack.IgnorePlugin(/redux-logger/),
2021-04-26 08:22:13 +00:00
// 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
});