forked from UNDP-Data/Energy-Hub-Dashboard
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcraco.config.js
32 lines (31 loc) · 1.03 KB
/
craco.config.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
/* eslint-disable no-console */
/* eslint-disable no-param-reassign */
module.exports = {
webpack: {
configure: (webpackConfig) => {
// Don't split up the runtime or our chunks
webpackConfig.optimization.runtimeChunk = false;
webpackConfig.optimization.splitChunks = false;
// Make sure main JS bundle is at same URL.
webpackConfig.output.filename = 'static/js/[name].js';
// Main css bundle should be the same spot too
const cssPlugin = webpackConfig.plugins.find(
(plugin) => plugin.options
&& plugin.options.filename
&& plugin.options.filename.endsWith('css'),
);
if (cssPlugin) {
cssPlugin.options.filename = 'static/css/[name].css';
cssPlugin.options.moduleFilename = () => 'static/css/main.css';
} else {
console.log('Could not locate CSS plugin. oh no.');
}
return webpackConfig;
},
},
babel:{
loaderOptions: {
ignore: ['./node_modules/maplibre-gl/dist/maplibre-gl.js']
}
}
};