Skip to content

Commit 671f4ca

Browse files
RunDevelopmentmAAdhaTTah
authored andcommitted
Improve gulp error messages with pump (#1741)
1 parent d9fa29a commit 671f4ca

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

gulpfile.js

+23-12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var gulp = require('gulp'),
44
header = require('gulp-header'),
55
concat = require('gulp-concat'),
66
replace = require('gulp-replace'),
7+
pump = require('pump'),
78
fs = require('fs'),
89

910
paths = {
@@ -52,12 +53,17 @@ var gulp = require('gulp'),
5253
);
5354
};
5455

55-
gulp.task('components', function() {
56-
return gulp.src(paths.components)
57-
.pipe(inlineRegexSource())
58-
.pipe(uglify())
59-
.pipe(rename({ suffix: '.min' }))
60-
.pipe(gulp.dest('components'));
56+
gulp.task('components', function(cb) {
57+
pump(
58+
[
59+
gulp.src(paths.components),
60+
inlineRegexSource(),
61+
uglify(),
62+
rename({ suffix: '.min' }),
63+
gulp.dest('components')
64+
],
65+
cb
66+
);
6167
});
6268

6369
gulp.task('build', function() {
@@ -69,12 +75,17 @@ gulp.task('build', function() {
6975
.pipe(gulp.dest('./'));
7076
});
7177

72-
gulp.task('plugins', ['languages-plugins'], function() {
73-
return gulp.src(paths.plugins)
74-
.pipe(inlineRegexSource())
75-
.pipe(uglify())
76-
.pipe(rename({ suffix: '.min' }))
77-
.pipe(gulp.dest('plugins'));
78+
gulp.task('plugins', ['languages-plugins'], function(cb) {
79+
pump(
80+
[
81+
gulp.src(paths.plugins),
82+
inlineRegexSource(),
83+
uglify(),
84+
rename({ suffix: '.min' }),
85+
gulp.dest('plugins')
86+
],
87+
cb
88+
);
7889
});
7990

8091
gulp.task('components-json', function (cb) {

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
2727
"gulp-concat": "^2.3.4",
2828
"gulp-header": "^1.0.5",
2929
"gulp-rename": "^1.2.0",
30-
"gulp-uglify": "^0.3.1",
3130
"gulp-replace": "^0.5.4",
31+
"gulp-uglify": "^0.3.1",
3232
"mocha": "^2.2.5",
33+
"pump": "^3.0.0",
3334
"yargs": "^3.26.0"
3435
},
3536
"jspm": {

0 commit comments

Comments
 (0)