Skip to content

Instantly share code, notes, and snippets.

@bebraw
Created September 4, 2015 06:28
Embed
What would you like to do?
How to configure Babel for production/development?
{
"env": {
"build": {
"stage": 2
}
}
}
{
...
"scripts": {
"build": "webpack",
"start": "webpack-dev-server"
},
...
}
...
// process.env.npm_lifecycle_event matches with "npm run"
process.env.BABEL_ENV = process.env.npm_lifecycle_event;
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment