-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
89 lines (75 loc) · 2.33 KB
/
webpack.config.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/* eslint-env node */
const
path = require("path"),
TerserPlugin = require("terser-webpack-plugin"),
ProgressBarPlugin = require("progress-bar-webpack-plugin");
module.exports = {
mode: "development",
context: path.resolve(__dirname, "./src"),
entry: {
"ccpwgl2_int": "./index.js",
"ccpwgl2_int.min": "./index.js"
},
performance: {
maxEntrypointSize: 2000000,
maxAssetSize: 2000000
},
devtool: "none",
resolve: {
alias: {
"core": path.resolve(__dirname, "./src/core"),
"curve": path.resolve(__dirname, "./src/curve"),
"eve": path.resolve(__dirname, "./src/eve"),
"interior": path.resolve(__dirname, "./src/interior"),
"particle": path.resolve(__dirname, "./src/particle"),
"sof": path.resolve(__dirname, "./src/sof"),
"state": path.resolve(__dirname, "./src/state"),
"wrapped": path.resolve(__dirname, "./src/wrapped"),
"unsupported": path.resolve(__dirname, "./src/unsupported"),
// We'll fix these later
"global" : path.resolve(__dirname, "./src/global"),
"math": path.resolve(__dirname, "./src/global/math"),
"utils": path.resolve(__dirname, "./src/global/utils"),
"engine": path.resolve(__dirname, "./src/global/engine"),
"constant": path.resolve(__dirname, "./src/global/constant")
}
},
optimization: {
minimize: false,
},
output: {
path: path.resolve(__dirname, "./dist"),
filename: "[name].js",
//library: "CCPWGL",
libraryTarget: "umd"
},
plugins: [
new ProgressBarPlugin(),
new TerserPlugin({
include: /\.min\.js$/,
terserOptions: {
output: {
comments: false
}
}
})
],
module: {
rules: [
{
enforce: "pre",
test: /\.js$/,
exclude: /node_modules/,
loader: "eslint-loader",
options: {
"fix": true
}
},
{
test: /\.js$/,
exclude: [ /node_modules/ ],
loader: "babel-loader"
}
]
}
};