-
Notifications
You must be signed in to change notification settings - Fork 0
/
craco.config.js
37 lines (35 loc) · 983 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
// eslint-disable-next-line import/no-extraneous-dependencies
const webpack = require('webpack');
module.exports = {
webpack: {
plugins: {
add: [
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
new webpack.IgnorePlugin({
checkResource(resource) {
return /.*\/wordlists\/(?!english).*\.json/.test(resource);
},
}),
new webpack.IgnorePlugin({
resourceRegExp: /bip39\/src$/,
}),
],
},
configure: (webpackConfig) => {
webpackConfig.resolve = {
...webpackConfig?.resolve,
fallback: {
...webpackConfig?.resolve?.fallback,
buffer: require.resolve('buffer'),
crypto: require.resolve('crypto-browserify'),
path: require.resolve('path-browserify'),
stream: require.resolve('stream-browserify'),
fs: false,
},
};
return webpackConfig;
},
},
};