remove use of gulp-rename and add gulp-plumber to prevent crashing on build errors

This commit is contained in:
Sebastian McKenzie 2015-11-08 06:02:36 -08:00
parent 5f8aa92ea3
commit 064fdb41fc
2 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,5 @@
var plumber = require("gulp-plumber");
var through = require("through2"); var through = require("through2");
var rename = require("gulp-rename");
var chalk = require("chalk"); var chalk = require("chalk");
var newer = require("gulp-newer"); var newer = require("gulp-newer");
var babel = require("gulp-babel"); var babel = require("gulp-babel");
@ -15,18 +15,18 @@ gulp.task("default", ["build"]);
gulp.task("build", function () { gulp.task("build", function () {
return gulp.src(scripts) return gulp.src(scripts)
.pipe(rename(function (file) { .pipe(plumber())
file.dirname = file.dirname.replace(/^([^\\]+)\/src/, "$1/lib"); .pipe(through.obj(function (file, enc, callback) {
file._path = file.path;
file.path = file.path.replace(/^([^\\]+)\/src/, "$1/lib");
callback(null, file);
})) }))
.pipe(newer(dest)) .pipe(newer(dest))
.pipe(through.obj(function (file, enc, callback) { .pipe(through.obj(function (file, enc, callback) {
gutil.log("Compiling", "'" + chalk.cyan(file.path) + "'..."); gutil.log("Compiling", "'" + chalk.cyan(file._path) + "'...");
callback(null, file); callback(null, file);
})) }))
.pipe(babel()) .pipe(babel())
.on("error", function (err) {
console.error(err.stack);
})
.pipe(gulp.dest(dest)); .pipe(gulp.dest(dest));
}); });

View File

@ -17,7 +17,7 @@
"gulp": "^3.9.0", "gulp": "^3.9.0",
"gulp-babel": "^5.3.0", "gulp-babel": "^5.3.0",
"gulp-newer": "^1.0.0", "gulp-newer": "^1.0.0",
"gulp-rename": "^1.2.2", "gulp-plumber": "^1.0.1",
"gulp-util": "^3.0.7", "gulp-util": "^3.0.7",
"gulp-watch": "^4.3.5", "gulp-watch": "^4.3.5",
"istanbul": "^0.3.5", "istanbul": "^0.3.5",