-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
63 lines (57 loc) · 1.23 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
var path = require("path");
const webpack = require("webpack");
var buildPath = path.resolve("src");
module.exports = (env) => ({
mode: env && env.prod ? "production" : "development",
plugins: [
new webpack.ProvidePlugin({
BOX: "box",
loader: "loader",
}),
],
entry: ["./src/client.js"],
output: {
path: buildPath,
filename: "client.js",
},
resolve: {
alias: {
"@babylonjs": path.resolve("node_modules/@babylonjs"),
box: path.resolve(__dirname, "core/box"),
loader: path.resolve(__dirname, "core/loader"),
},
},
performance: {
// change the default size warnings
maxEntrypointSize: 1.5e6,
maxAssetSize: 1.5e6,
},
stats: {
modules: false,
},
devtool: "source-map",
devServer: {
contentBase: buildPath,
inline: true,
host: "127.0.0.1",
stats: "minimal",
},
// optimising build CPU and DEV server
watchOptions: {
aggregateTimeout: 500,
poll: 1000,
ignored: ["node_modules"],
},
// split out babylon to a separate bundle
optimization: {
splitChunks: {
cacheGroups: {
babylon: {
chunks: "initial",
test: /babylonjs/,
filename: "babylon.js",
},
},
},
},
});