-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcraco.config.js
More file actions
28 lines (27 loc) · 826 Bytes
/
craco.config.js
File metadata and controls
28 lines (27 loc) · 826 Bytes
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
const webpack = require('webpack');
module.exports = {
webpack: {
configure: (webpackConfig) => {
webpackConfig.resolve.alias = {
...webpackConfig.resolve.alias,
process: 'process/browser',
};
webpackConfig.resolve.fallback = {
...webpackConfig.resolve.fallback,
crypto: require.resolve('crypto-browserify'),
buffer: require.resolve('buffer/'),
stream: require.resolve('stream-browserify'),
vm: require.resolve('vm-browserify'),
'process/browser': require.resolve('process/browser'),
};
webpackConfig.plugins = [
...webpackConfig.plugins,
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer'],
}),
];
return webpackConfig;
},
},
};