Skip to content

Instantly share code, notes, and snippets.

@mderijcke
Created April 20, 2016 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mderijcke/f3f243e8bb43a0c1c6ebfcbe52cf1295 to your computer and use it in GitHub Desktop.
Save mderijcke/f3f243e8bb43a0c1c6ebfcbe52cf1295 to your computer and use it in GitHub Desktop.
Gulp Babel
const babel = require("gulp-babel")
const cache = require("gulp-cached")
const gulp = require("gulp")
const plumber = require("gulp-plumber")
gulp.task("compile", () =>
gulp.src("src/**/*.js")
.pipe(plumber())
.pipe(cache("babel"))
.pipe(babel())
.pipe(gulp.dest("lib"))
)
gulp.task("watch", () =>
gulp.watch("src/**/*.js", ["compile"])
)
gulp.task("default", ["watch", "compile"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment