This line appears in the default Expo babel.config.js
, but I can't find any reference anywhere to what it does. Is there anyone who knows what this does?
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
This line appears in the default Expo babel.config.js
, but I can't find any reference anywhere to what it does. Is there anyone who knows what this does?
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
Share
Improve this question
edited Oct 6, 2023 at 9:35
Henke - Нава́льный П с м
5,7676 gold badges41 silver badges51 bronze badges
asked Dec 12, 2018 at 0:50
SlboxSlbox
13.1k16 gold badges64 silver badges131 bronze badges
1 Answer
Reset to default 22By default, Babel will evaluate configuration each time it processes a new file. It is possible to optimize the build process performance by caching config function execution result. api.cache(true)
does exactly that. When the cache is enabled this way, config function will be called only once.
Here is a link for a more detailed explanation of Babel configuration caching: https://babeljs.io/docs/en/config-files#apicache