Skip to content

Commit

Permalink
Improve gulp error messages with pump (#1741)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored and mAAdhaTTah committed Feb 15, 2019
1 parent d9fa29a commit 671f4ca
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
35 changes: 23 additions & 12 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var gulp = require('gulp'),
header = require('gulp-header'),
concat = require('gulp-concat'),
replace = require('gulp-replace'),
pump = require('pump'),
fs = require('fs'),

paths = {
Expand Down Expand Up @@ -52,12 +53,17 @@ var gulp = require('gulp'),
);
};

gulp.task('components', function() {
return gulp.src(paths.components)
.pipe(inlineRegexSource())
.pipe(uglify())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('components'));
gulp.task('components', function(cb) {
pump(
[
gulp.src(paths.components),
inlineRegexSource(),
uglify(),
rename({ suffix: '.min' }),
gulp.dest('components')
],
cb
);
});

gulp.task('build', function() {
Expand All @@ -69,12 +75,17 @@ gulp.task('build', function() {
.pipe(gulp.dest('./'));
});

gulp.task('plugins', ['languages-plugins'], function() {
return gulp.src(paths.plugins)
.pipe(inlineRegexSource())
.pipe(uglify())
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('plugins'));
gulp.task('plugins', ['languages-plugins'], function(cb) {
pump(
[
gulp.src(paths.plugins),
inlineRegexSource(),
uglify(),
rename({ suffix: '.min' }),
gulp.dest('plugins')
],
cb
);
});

gulp.task('components-json', function (cb) {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
"gulp-concat": "^2.3.4",
"gulp-header": "^1.0.5",
"gulp-rename": "^1.2.0",
"gulp-uglify": "^0.3.1",
"gulp-replace": "^0.5.4",
"gulp-uglify": "^0.3.1",
"mocha": "^2.2.5",
"pump": "^3.0.0",
"yargs": "^3.26.0"
},
"jspm": {
Expand Down

0 comments on commit 671f4ca

Please sign in to comment.