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
}
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.
 
                     
                    
                 
                    
                 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号