-
Notifications
You must be signed in to change notification settings - Fork 673
Allow custom BABEL_ENV for transformer #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I have a complex .babelrc.js configuration (for server, for web and also for react-native (metro)). It would be nice to allow for developers to provide its own `BABEL_ENV` name. For now, it is forced to be `production` or `development`. And it's bad developer experience. Of course `METRO_BABEL_ENV` is not a good solution. Better will be to use already defined BABEL_ENV variable from process, but if it not defined use `production` or `development` as a fallback. With proposed changes it can be used in following manner: ```bash $ METRO_BABEL_ENV=native_dev node node_modules/react-native/local-cli/cli.js start ``` or even better will be (but it may introduce some problems in existing apps) ```bash $ BABEL_ENV=native_dev node node_modules/react-native/local-cli/cli.js start ``` Thoughts?
How so? I'm not entirely sure, but I can only think of apps that export some "unusual"
I'd vote for this. My use case is that I need to be able to specify several different configs with @nodkz currently your PR doesn't pass some tests. Maybe you can fix (to pass |
|
@frantic maybe remember why was added replacement for standard metro/packages/metro/src/reactNativeTransformer.js Lines 154 to 174 in 5f0cca1
@angly-cat I fixed lint errors. With failed node6 I don't know what to do. |
Check the MR where this was added ans this comment in particular. If that's the idea, then to comply with it the code should be something like |
|
Sorry for the super late response. It seems like now this is pretty outdated and files have moved. If you want to send this PR again with the proposal by @angly-cat, I'm happy to merge it much faster :) |
I have a complex .babelrc.js configuration (for server, for web and also for react-native (metro)).
It would be nice to allow for developers to provide its own
BABEL_ENVname.For now, it is forced to be
productionordevelopment. And it's bad developer experience.Of course
METRO_BABEL_ENVis not a good solution. Better will be to use already defined BABEL_ENV variable from process, but if it not defined useproductionordevelopmentas a fallback.With proposed changes it can be used in following manner:
or even better will be (but it may introduce some problems in existing apps)
Thoughts?