Skip to content

Commit d96994d

Browse files
author
JelteMX
committed
Add plumber to Gulp to prevent an error killing the watch task
1 parent 11128fa commit d96994d

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

generators/app/templates/Gulpfile.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ var gulp = require("gulp"),
1414
del = require("del"),
1515
newer = require("gulp-newer"),
1616
gutil = require("gulp-util"),
17+
plumber = require("gulp-plumber"),
1718
gulpif = require("gulp-if"),
1819
jsonTransform = require("gulp-json-transform"),
1920
intercept = require("gulp-intercept"),
@@ -47,6 +48,15 @@ gulp.task("compress", ["clean"], function () {
4748

4849
gulp.task("copy:js", function () {
4950
return gulp.src(["./src/**/*.js"])
51+
.pipe(plumber(function (error) {
52+
var msg = gutil.colors.red("Error");
53+
if (error.fileName) {
54+
msg += gutil.colors.red(" in ") + gutil.colors.cyan(error.fileName);
55+
}
56+
msg += " : " + gutil.colors.cyan(error.message);
57+
gutil.log(msg);
58+
this.emit("end");
59+
}))
5060
.pipe(jsValidate())
5161
.pipe(newer(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER))
5262
.pipe(gulp.dest(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER));

generators/app/templates/_package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"gulp-intercept": "^0.1.0",
2828
"gulp-json-transform": "^0.4.2",
2929
"gulp-newer": "^1.3.0",
30+
"gulp-plumber": "^1.1.0",
3031
"gulp-util": "^3.0.7",
3132
"gulp-zip": "^3.2.0",
3233
"gulp-jsvalidate": "^3.0.0",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-mendix",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "Mendix Widget generator",
55
"license": "MIT",
66
"main": "app/index.js",

0 commit comments

Comments
 (0)