remove use of gulp-rename and add gulp-plumber to prevent crashing on build errors
This commit is contained in:
parent
5f8aa92ea3
commit
064fdb41fc
14
Gulpfile.js
14
Gulpfile.js
@ -1,5 +1,5 @@
|
||||
var plumber = require("gulp-plumber");
|
||||
var through = require("through2");
|
||||
var rename = require("gulp-rename");
|
||||
var chalk = require("chalk");
|
||||
var newer = require("gulp-newer");
|
||||
var babel = require("gulp-babel");
|
||||
@ -15,18 +15,18 @@ gulp.task("default", ["build"]);
|
||||
|
||||
gulp.task("build", function () {
|
||||
return gulp.src(scripts)
|
||||
.pipe(rename(function (file) {
|
||||
file.dirname = file.dirname.replace(/^([^\\]+)\/src/, "$1/lib");
|
||||
.pipe(plumber())
|
||||
.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(through.obj(function (file, enc, callback) {
|
||||
gutil.log("Compiling", "'" + chalk.cyan(file.path) + "'...");
|
||||
gutil.log("Compiling", "'" + chalk.cyan(file._path) + "'...");
|
||||
callback(null, file);
|
||||
}))
|
||||
.pipe(babel())
|
||||
.on("error", function (err) {
|
||||
console.error(err.stack);
|
||||
})
|
||||
.pipe(gulp.dest(dest));
|
||||
});
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-babel": "^5.3.0",
|
||||
"gulp-newer": "^1.0.0",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-plumber": "^1.0.1",
|
||||
"gulp-util": "^3.0.7",
|
||||
"gulp-watch": "^4.3.5",
|
||||
"istanbul": "^0.3.5",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user