-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-overrides.js
41 lines (41 loc) · 1.05 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
const Visualizer = require('webpack-visualizer-plugin');
module.exports = (config, env) => {
config.optimization.runtimeChunk = false;
config.optimization.flagIncludedChunks = true;
config.optimization.splitChunks = {
cacheGroups: {
default: false,
},
};
config.plugins.push(
new Visualizer({
filename: './statistics.html',
enabled: false,
})
);
config.devServer = {
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': '*',
'Access-Control-Allow-Headers': '*',
},
allowedHosts: ['localhost:3000'],
};
config.externals = [
{
// react: 'React',
// 'react-dom': 'ReactDOM',
},
// externalMaterialUI,
];
function externalMaterialUI(_, module, callback) {
var isMaterialUIComponent = /^@material-ui\/core\/([^/]+)$/;
var match = isMaterialUIComponent.exec(module);
if (match !== null) {
var component = match[1];
return callback(null, `'@material-ui/core/${component}'`);
}
callback();
}
return config;
};