[bug] Not possible to fully disable caching using Babel api
Is there a way to fully disable React Native Packager caching?
We have a very small application that is only used for showing the assets. All assets files are imported automatically from special directory using babel-plugin-codegen. The problem is that these imports do not regenerate on files change. It seems that Babel just doesn't support partial caching. So, the solution is to rebuild the whole app every time it reloads in Simulator.
Unfortunately methods described in Babel docs don’t work for some reason with Metro Bundler. This is our babel.config.js
module.exports = function (api) {
api.cache.never()
return {
presets: ['module:metro-react-native-babel-preset'],
plugins: ['macros']
}
}
and these are our dependencies (project is created with react-native init yesterday)
"react-native": "0.62.2"
"metro-react-native-babel-preset": "^0.58.0",
Thanks for your help in advance!
@serhiipalash did you find a solution for this? I am experiencing this with another babel-plugin, called react-native-dotenv.
@serhiipalash Metro has its own per-file caching. Have you tried setting the cacheStores in the metro config to an empty list (no caching, even for incremental builds) or set resetCache: true (no caching for first build after metro starts)