-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.prod.js
More file actions
46 lines (44 loc) · 954 Bytes
/
webpack.prod.js
File metadata and controls
46 lines (44 loc) · 954 Bytes
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
34
35
36
37
38
39
40
41
42
43
44
45
46
/* eslint-env node */
const common = require("./webpack.common");
const TerserPlugin = require("terser-webpack-plugin");
module.exports = (env, argv) => {
let config = common(env, argv);
return {
...config,
mode: "production",
devtool: "source-map",
optimization: {
splitChunks: {
chunks: "all",
},
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
format: {
ascii_only: true,
},
},
}),
],
},
module: {
...config.module,
rules: [
...config.module.rules,
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
cacheDirectory: true,
cacheCompression: false,
envName: "production",
},
},
},
],
},
};
};