-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
80 lines (74 loc) · 1.67 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
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require("path");
const browserbenchConfig = {
name: "browserbench",
target: "web",
mode: "production",
performance: { hints: false },
entry: path.resolve(__dirname, "src/browserbench/browser.bench.ts"),
output: {
path: path.resolve(__dirname, "serve-browserbench/public"),
filename: "browserbench.bundle.js",
library: "browserbench",
libraryTarget: "window"
},
externals: [],
resolve: {
extensions: [".ts", ".js", ".json"]
},
node: {
fs: "empty"
},
module: {
rules: [
{
test: /\.ts$/,
loader: "transform-loader?brfs"
},
{
test: /\.ts$/,
exclude: /node_modules/,
use: "ts-loader"
}
]
}
};
// WARNING: THIS IS A HACK
// The goal of libConfig is to inline .glsl files using
// transform-loader and not minifiy or "pack" anything at all
const glob = require("glob");
const EmitAllPlugin = require("webpack-emit-all-plugin");
const DisableOutputWebpackPlugin = require("disable-output-webpack-plugin");
const libConfig = {
name: "lib",
target: "web",
mode: "none",
performance: { hints: false },
optimization: {
minimize: false
},
entry: glob.sync("./lib/**/!(*.d|*.test|*.bench).js"),
externals: [],
resolve: {
extensions: [".ts", ".js", ".json"]
},
node: {
fs: "empty"
},
module: {
rules: [
{
test: /\.js$/,
loader: "transform-loader?brfs"
}
]
},
plugins: [
new DisableOutputWebpackPlugin(),
new EmitAllPlugin({
ignorePattern: /node_modules/,
path: "."
})
]
};
module.exports = [browserbenchConfig, libConfig];