-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-overrides.js
46 lines (45 loc) · 1.03 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
const { ProvidePlugin } = require("webpack");
module.exports = function (config, env) {
return {
...config,
module: {
...config.module,
rules: [
...config.module.rules,
{
test: /\.m?[jt]sx?$/,
enforce: "pre",
use: ["source-map-loader"],
},
{
test: /\.m?[jt]sx?$/,
resolve: {
fullySpecified: false,
},
},
],
},
plugins: [
...config.plugins,
new ProvidePlugin({
process: "process/browser",
}),
new ProvidePlugin({
process: "process/browser",
Buffer: ["buffer", "Buffer"],
}),
],
resolve: {
...config.resolve,
fallback: {
assert: require.resolve("assert"),
buffer: require.resolve("buffer"),
stream: require.resolve("stream-browserify"),
crypto: require.resolve("crypto-browserify"),
zlib: false,
path: false,
},
},
ignoreWarnings: [/Failed to parse source map/],
};
};