Skip to content

Instantly share code, notes, and snippets.

@TommyZG
Created November 12, 2017 15:08
Show Gist options
  • Save TommyZG/b91f406a6266c560968aaf0a5515ea3a to your computer and use it in GitHub Desktop.
Save TommyZG/b91f406a6266c560968aaf0a5515ea3a to your computer and use it in GitHub Desktop.
//Initialize your project using npm init (in project folder) and create a directory called src
//Install babel dependencies by running
npm install babel-cli -D
npm install babel-preset-env -D
//Create a .babelrc file inside your project and add the following code inside it:
{
"presets": ["env"]
}
//Add the following script to your scripts object in package.json:
"build": "babel src -d lib"
//Run npm run build whenever you want to transpile your code from your src to lib directories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment