Skip to content

Instantly share code, notes, and snippets.

@bebraw
Created September 4, 2015 06:28
Show Gist options
  • Save bebraw/d8690065e29c17c73342 to your computer and use it in GitHub Desktop.
Save bebraw/d8690065e29c17c73342 to your computer and use it in GitHub Desktop.
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