Skip to content
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

Use an argument to babel transform to determine environment #65

Open
zpao opened this issue Oct 1, 2015 · 0 comments
Open

Use an argument to babel transform to determine environment #65

zpao opened this issue Oct 1, 2015 · 0 comments

Comments

@zpao
Copy link
Member

zpao commented Oct 1, 2015

With the current transforms we need to do different things when we're in __DEV__. The way I made that work was to piggyback on process.env.NODE_ENV as we've done for some other things. However that makes it so that you can't just run standalone jest in a project, instead you have a test script: "test": "NODE_ENV=test jest". That's fine as long as you don't care much about Windows or making people use npm test. But we should make this as seamless as possible for FB engineers so they can just run jest (assuming of course that they have run npm install -g jest-cli at some point in the past).

Another workaround is to just explicitly set process.env in the preprocessor, as was done in React (for now) - facebook/react#5020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant