-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
craco.config.js
42 lines (41 loc) · 1.05 KB
/
craco.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
const webpack = require("webpack");
module.exports = {
babel: {
plugins: [
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining",
],
},
webpack: {
configure: {
module: {
exprContextCritical: false, // turns off Critical dependency: the request of a dependency is an expression error
},
experiments: {
topLevelAwait: true,
},
resolve: {
fallback: {
'@chainsafe/blst': false, // @chainsafe/blst is a peer dependency which is not needed in a browser environment
http: require.resolve("stream-http"),
https: require.resolve("https-browserify"),
crypto: false,
stream: false,
url: false,
os: false,
path: false,
zlib: false,
fs: false
},
},
},
plugins: [
new webpack.DefinePlugin({
process: { argv: [] },
}),
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),
],
},
};