You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCAD/config/webpack.prod.ts

35 lines
928 B

import * as webpack from 'webpack';
import merge from 'webpack-merge';
import common from './webpack.common';
const CleanWebpackPlugin = require("clean-webpack-plugin");
import TerserPlugin = require('terser-webpack-plugin');
const config: webpack.Configuration = merge(
common,
{
mode: "production",
devtool: "source-map",
optimization: {
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
sourceMap: true,
terserOptions: {
ecma: 7,
sourceMap: true,
keep_classnames: true,
}
}),
]
},
plugins: [
new CleanWebpackPlugin([`./dist/*.main.js*`], { root: path.resolve(__dirname, "..") }),
]
}
);
export default config;