-
Notifications
You must be signed in to change notification settings - Fork 2
/
config-overrides.js
53 lines (50 loc) · 1.15 KB
/
config-overrides.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
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
module.exports = function override(config, env) {
config.module.rules.push({
test: /\.worker\.js$/,
use: { loader: "worker-loader" },
});
config.plugins.push(
new NodePolyfillPlugin({
excludeAliases: [
"assert",
"console",
"constants",
"crypto",
"domain",
"events",
"http",
"https",
"os",
"path",
"punycode",
"querystring",
"_stream_duplex",
"_stream_passthrough",
"_stream_transform",
"_stream_writable",
"string_decoder",
"sys",
"timers",
"tty",
"url",
"util",
"vm",
"zlib",
],
})
);
config.resolve.fallback = {
fs: false,
tls: false,
net: false,
http: require.resolve("stream-http"),
https: false,
zlib: require.resolve("browserify-zlib"),
path: require.resolve("path-browserify"),
stream: require.resolve("stream-browserify"),
util: require.resolve("util/"),
crypto: require.resolve("crypto-browserify"),
};
return config;
};