forked from UNDP-Data/ea-africa-project-map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcraco.config.js
27 lines (26 loc) · 953 Bytes
/
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
/* 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;
},
},
};