Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

chore: use seperate babel config for dev/prod

ammarahm-ed7944761827d1
diff --git a/apps/mobile/babel.config.js b/apps/mobile/babel.config.js
index 3b3890bb6..b14de0fe7 100644
--- a/apps/mobile/babel.config.js
+++ b/apps/mobile/babel.config.js
@@ -1,4 +1,19 @@
-module.exports = {
- presets: ['module:metro-react-native-babel-preset'],
- plugins: ['transform-remove-console', '@babel/plugin-transform-named-capturing-groups-regex']
+let env = process.env.BABEL_ENV;
+const configs = {
+ env: {
+ development: {
+ presets: ['module:metro-react-native-babel-preset'],
+ plugins: ['@babel/plugin-transform-named-capturing-groups-regex']
+ },
+ production: {
+ presets: ['module:metro-react-native-babel-preset'],
+ plugins: ['transform-remove-console', '@babel/plugin-transform-named-capturing-groups-regex']
+ }
+ }
+};
+module.exports = function (api, opts) {
+ api.cache(true);
+ if (!env) env = 'production';
+ console.log('babel-env:', env);
+ return configs.env[env];
};