forked from Animesh239/website-connect_ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-overrides.js
29 lines (25 loc) · 953 Bytes
/
config-overrides.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
const webpack = require('webpack');
const WorkBoxPlugin = require('workbox-webpack-plugin');
module.exports = function override(config) {
config.resolve.fallback = {
process: require.resolve('process/browser'),
stream: require.resolve('stream-browserify'),
crypto: require.resolve('crypto-browserify'),
util: require.resolve('util'),
buffer: require.resolve('buffer')
};
// https://stackoverflow.com/questions/69135310/workaround-for-cache-size-limit-in-create-react-app-pwa-service-worker
config.plugins.forEach((plugin) => {
if (plugin instanceof WorkBoxPlugin.InjectManifest) {
plugin.config.maximumFileSizeToCacheInBytes = 50 * 1024 * 1024;
}
});
config.plugins = [
...config.plugins,
new webpack.ProvidePlugin({
process: 'process/browser.js',
Buffer: ['buffer', 'Buffer']
})
];
return config;
};