-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcraco.config.js
39 lines (35 loc) · 1001 Bytes
/
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
module.exports = {
webpack: {
configure: (webpackConfig) => {
webpackConfig.experiments = {
asyncWebAssembly: true,
topLevelAwait: true,
layers: true,
};
webpackConfig.output = {
...webpackConfig.output,
environment: {
...webpackConfig.output?.environment,
asyncFunction: true,
},
};
webpackConfig.resolve = {
...webpackConfig.resolve,
fallback: {
buffer: require.resolve("buffer"),
crypto: require.resolve("crypto-browserify"),
stream: require.resolve("stream-browserify"),
https: require.resolve("https-browserify"),
http: require.resolve("stream-http"),
querystring: require.resolve("querystring-es3"),
url: require.resolve("url/")
},
};
webpackConfig.module.rules.push({
test: /\.wasm$/,
type: "webassembly/async",
});
return webpackConfig;
},
},
};