Created
September 4, 2015 06:28
-
-
Save bebraw/d8690065e29c17c73342 to your computer and use it in GitHub Desktop.
How to configure Babel for production/development?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"env": { | |
"build": { | |
"stage": 2 | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
... | |
"scripts": { | |
"build": "webpack", | |
"start": "webpack-dev-server" | |
}, | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
// 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