Skip to content

Instantly share code, notes, and snippets.

@nybblr
Created March 7, 2017 18:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nybblr/2afa8917b71bde6492c40c3a7b749ce1 to your computer and use it in GitHub Desktop.
Save nybblr/2afa8917b71bde6492c40c3a7b749ce1 to your computer and use it in GitHub Desktop.
ES2017 build pipeline in 5 seconds.
{
"presets": [
"es2015",
"es2016",
"es2017"
],
"plugins": []
}

Quickstart Build Pipeline for ES2017

  • Copy package.json and .babelrc into your project directory.
  • npm install
  • mkdir src && mkdir dist
  • Put your code in src
  • npm run build or npm run watch for live rebuilding.
  • Serve up the dist folder however you like.
{
"name": "my-app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "browserify -d src/index.js -o dist/index.js",
"watch": "watchify -v -d src/index.js -o dist/index.js"
},
"browserify": {
"transform": [ [ "babelify", { "sourceMap": true } ] ]
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-cli": "^6.16.0",
"babel-core": "^6.17.0",
"babel-polyfill": "^6.16.0",
"babel-preset-es2015": "^6.16.0",
"babel-preset-es2016": "^6.16.0",
"babel-preset-es2017": "^6.16.0",
"babelify": "^7.3.0",
"browserify": "^13.0.1",
"watchify": "^3.7.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment