Can I use a Gulp task with multiple sources and multiple destinations?

前端 未结 9 1342
遇见更好的自我
遇见更好的自我 2020-12-02 14:19

I have the following in my gulpfile.js:

   var sass_paths = [
        \'./httpdocs-site1/media/sass/**/*.scss\',
        \'./httpdocs-site2/media/sass/**/*         


        
9条回答
  •  伪装坚强ぢ
    2020-12-02 15:15

    Using gulp-if helps me a lot.

    The gulp-if first argument. is the gulp-match second argument condition

    gulp-if can be found in gulp-if

    import {task, src, dest} from 'gulp';
    import VinylFile = require("vinyl");
    const gulpif = require('gulp-if');
    
    src(['foo/*/**/*.md', 'bar/*.md'])
        .pipe(gulpif((file: VinylFile) => /foo\/$/.test(file.base), dest('dist/docs/overview')))
        .pipe(gulpif((file: VinylFile) => /bar\/$/.test(file.base), dest('dist/docs/guides')))
    });
    

提交回复
热议问题