forked from SHSGames/shsgames.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.production.js
More file actions
51 lines (48 loc) · 1.14 KB
/
webpack.production.js
File metadata and controls
51 lines (48 loc) · 1.14 KB
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
47
48
49
50
51
const path = require("path");
const webpack = require("webpack");
const DIST_DIR = path.resolve(__dirname, "dist");
const SRC_DIR = path.resolve(__dirname, "www");
const config = {
entry: SRC_DIR + "/app/index.js",
mode: "production",
output: {
path: DIST_DIR + "/app",
filename: "bundle.js",
publicPath: "/app/"
},
optimization: {
namedModules: false,
namedChunks: false,
nodeEnv: "production",
flagIncludedChunks: true,
occurrenceOrder: true,
sideEffects: true,
usedExports: true,
concatenateModules: true,
splitChunks: {
hidePathInfo: true,
minSize: 30000,
maxAsyncRequests: 5,
maxInitialRequests: 3,
},
noEmitOnErrors: true,
checkWasmTypes: true,
minimize: true,
},
plugins: [
new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify("production")
}),
new webpack.optimize.UglifyJsPlugin({
extractComments: true,
parallel: true,
mangle: true,
ie8: false,
compress: {
warnings: false,
}
})
],
module: { loaders: require("./loaders.js")(SRC_DIR) }
};
module.exports = config;