forked from KathiraveluLab/DHGWorkflow
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathcraco.config.js
More file actions
31 lines (27 loc) · 990 Bytes
/
craco.config.js
File metadata and controls
31 lines (27 loc) · 990 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
29
30
31
const webpack = require('webpack');
module.exports = {
webpack: {
configure: (webpackConfig) => {
const newConfig = { ...webpackConfig }; // copy the original config
newConfig.resolve = {
...newConfig.resolve,
fallback: {
...newConfig.resolve.fallback,
timers: require.resolve('timers-browserify'),
util: require.resolve('util/'),
stream: require.resolve('stream-browserify'),
buffer: require.resolve('buffer/'),
process: require.resolve('process/browser.js'),
},
};
newConfig.plugins = [
...newConfig.plugins,
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
process: 'process/browser.js',
}),
];
return newConfig;
},
},
};