Remove console.log in Production to Enhance Performance (babel-plugin-transform-remove-console)

I would like to remove all the console.log in production to make my app a bit faster and found this article. But how and where do I add this plug-in in Expo? Or, any other way to achieve the same goal? Many thanks!

hello! you can add it to babel.config.js. you should have one in your project that looks roughly like this: expo/babel.config.js at 896a29e5abbe285c7cba89a03053696216dd2793 · expo/expo · GitHub

also note that you should only do this in production by using the env config as you can see in that blog post. note that you should not change from babel-preset-expo to 'module:metro-react-native-babel-preset' - that is not required and will cause problems for you

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.