ES7+ gulpfile
JS
S
JavaScriptBasic gulpfile.js to perform automatic transpiling on watch on ES7+. Contains Babel Core v.7.0 with es2017 presets.
1var gulp = require("gulp");
2var babel = require("gulp-babel");
3var watch = require("gulp-watch");
4
5const SRC_FILES = "app/src/**/*.js";
6const DEST = "app/build";
7
8gulp.task("babel", function(){
9 return watch(SRC_FILES, function(){
10 console.log("Transpiling via babel..:", SRC_FILES);
11 console.log("Files Transpiled.", DEST);
12 return gulp.src(SRC_FILES)
13 .pipe(babel())
14 .pipe(gulp.dest(DEST));
15 });
16});
17Created on 6/14/2017