Search code examples
react-nativebabeljs

Babel config only loaded once per reboot in React Native app?


I'm not quite sure what's going on here, but I have a React Native app that was ejected from Expo, with a babel.config.js defined, on Babel 7.9.0. I've thrown a console log in there to see if the config ever gets loaded, i.e.

module.exports = function (api) {
    console.log('loading babel config!!!!!!!!!!!!!!!!!!!!!!!!!!!!');

    api.cache(true);
    return {
        presets: ['babel-preset-expo'],
    };
};

But the console log only ever seems to print out once, and never again until I reboot my computer, even if I change the file, clear my yarn cache, or node_modules.


Solution

  • Actually, just figured it out: looks like I needed to clear the React Native cache itself before the config gets reloaded: yarn react-native start --reset-cache