Calling gulp to do stuff with file stream build;
作者:互联网
const gulp = require('gulp')
const gulpUtil = require('gulp-util')
function runGulp() { gulpUtil.log('stuff happened', 'Really it did', gulpUtil.colors.magenta('123')); gulp.watch('./*.css', css) }
//whenever when the sass file changes, function css(cb) { mylog(22)
gulp.src('*.css').pipe(gulp.dest('css/'))//pipe method receives file stream,, gulp.src('*.html').pipe(gulp.dest('html/'))//pipe method receives file stream,, // body omitted cb(); }
module.exports = { runGulp }
function runGulp() { gulpUtil.log('stuff happened', 'Really it did', gulpUtil.colors.magenta('123')); gulp.watch('./*.css', css) }
//whenever when the sass file changes, function css(cb) { mylog(22)
gulp.src('*.css').pipe(gulp.dest('css/'))//pipe method receives file stream,, gulp.src('*.html').pipe(gulp.dest('html/'))//pipe method receives file stream,, // body omitted cb(); }
module.exports = { runGulp }
I have sealed gulp in a single file and do not want to define gulpfile and tasks but use it in nodejs, this stull can watch glob, and do building etc.
标签:do,pipe,stream,Calling,gulp,file,css 来源: https://www.cnblogs.com/hualiu0/p/16435925.html