-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.prod.js
33 lines (31 loc) · 964 Bytes
/
webpack.prod.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const webpack = require("webpack");
const webpackMerge = require("webpack-merge");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const commonConfig = require("./webpack.common.js");
const helpers = require("./helpers");
const ENV = process.env.NODE_ENV = process.env.ENV = "production";
module.exports = webpackMerge(commonConfig, {
mode: "production",
output: {
path: helpers.root("dist/web-app"),
publicPath: "",
filename: "[name].[hash].js",
chunkFilename: "[id].[hash].chunk.js"
},
module: {
rules: [
{test: /\.ts$/, use: "awesome-typescript-loader?configFileName=conf/tsconfig.prod.json"}
]
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new webpack.DefinePlugin({
"process.env": {
"ENV": JSON.stringify(ENV)
}
})
],
optimization: {
minimizer: [new UglifyJsPlugin()]
}
});