Closed little-buddy closed 1 year ago
The configuration file isn't guaranteed to be loaded only once. However, the configuration itself should only be loaded once. You can switch your export to be a function instead of an object.
/* craco.config.js */
module.exports = () => {
// stuff here should only run once
return {
// your craco config
};
};
What's happening run craco start/build, it will exec twice craco.config.js
What should happen run once
To reproduce craco start or craco build
CRACO version 7.1.0
CRACO config
package.json
Additional information I found that it executes crac.config.js once to determine if crac.config.js exists, and then again when using merge