gulp debug and log


gulp-debug插件可以显示哪些文件经过了gulp的流水线(pipeline)

安装

$ npm install --save-dev gulp-debug

使用

var gulp = require('gulp');
var debug = require('gulp-debug');

gulp.task('default', function () {
    return gulp.src('foo.js')
        .pipe(debug())
        .pipe(gulp.dest('dist'));
});

gulp运行时就会输出流中所有处理的文件名:

[22:20:36] gulp-debug: foo.js

使用gulp-util输出错误

// minify js
gulp.task('minifyJs', ['clean'], function(){
    return gulp.src(['**/*.js'])
        .pipe(uglify().on('error', util.log))
        .pipe(debug())
        .pipe(gulp.dest('dist'));
});

References:
[1]gulp-debug
[2]Utilities for gulp plugins

===
[erq]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.