-
Notifications
You must be signed in to change notification settings - Fork 4
/
config-overrides.js
52 lines (46 loc) · 1.33 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const webpack = require('webpack');
module.exports = {
webpack: (webpackConfig) => {
webpackConfig.resolve.fallback = {
...webpackConfig.resolve.fallback,
url: require.resolve('url/'),
querystring: require.resolve('querystring-es3'),
};
const basename = process.env.BASENAME;
if (basename) {
webpackConfig.output.publicPath = `/${basename}/`;
webpackConfig.plugins.push(
new webpack.DefinePlugin({
_BASENAME_: `'${basename}'`,
})
);
}
return webpackConfig;
},
devServer: (configFunction) => {
return function (proxy, allowedHost) {
// Create the default config
const config = configFunction(proxy, allowedHost);
config.client = {
...config.client,
overlay: {
...config.client.overlay,
runtimeErrors: (error) => {
/**
* This error occurs every time a version is selected in the wizard,
* and causes the overlay to appear. It is stemming from a package.
*/
if (
error?.message === 'ResizeObserver loop completed with undelivered notifications.'
) {
console.error(error);
return false;
}
return true;
},
},
};
return config;
};
},
};