Last active
August 29, 2015 14:24
-
-
Save DanielFGray/e85ca689ac100544bf2a to your computer and use it in GitHub Desktop.
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
"use strict"; | |
var gulp = require("gulp"), | |
sourcemaps = require("gulp-sourcemaps"), | |
babel = require("gulp-babel"), | |
concat = require("gulp-concat"), | |
uglify = require("gulp-uglify"), | |
rename = require("gulp-rename"), | |
del = require("del"); | |
gulp.task("js", function() { | |
return gulp.src("src/**/*.js") | |
.pipe(sourcemaps.init({ loadMaps: true })) | |
.pipe(concat("main.js")) | |
.pipe(babel()) | |
.pipe(gulp.dest("dist")) | |
.pipe(rename({ suffix: ".min" })) | |
.pipe(uglify()) | |
.pipe(sourcemaps.write("./", { includeContent: false })) | |
.pipe(gulp.dest("dist")); | |
}); | |
gulp.task("resources", ["js"]); | |
gulp.task("clean", function(cb) { | |
del(["dist/*"], cb); | |
}); | |
gulp.task("default", ["clean"], function() { | |
gulp.start("resources"); | |
}); | |
gulp.task("watch", function() { | |
gulp.watch("src/**/*.js", ["default"]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment