gulp-if

Conditional gulp task inside gulp.paralell() or gulp.series()

假装没事ソ 提交于 2019-12-11 06:05:43
问题 Too much information about conditions tasks inside pipes (e. g. "gulp-if" plugin). However, actually it is not "conditional tasks": it is the "conditional plugin usage", and one task can use multiple plugins. Here is how to conditionally run task NOT inside pipe (for example, inside gulp.paralell() ) Suppose that task name can contain spaces for providing easy-to-understand task meaning. gulp.task('Build', gulp.paralell( 'Preprocess HTML', 'Prepeocess styles', done => { if(checkSomeCondition(

Switch output folder based on filename in gulp task

自作多情 提交于 2019-12-08 09:12:19
问题 I have different *.scss files in my src folder and I want one file to be compiled in its own separate folder. Lets assume I have the files normalFile_1.scss , specialFile.scss , normalFile_2.scss . I want the two normal files to be compiled to the folder Public/Css , the special file however should end up in the folder Public/Css/Special . I have tried to get the current filename in the task with gulp-tap , which works fine. .pipe($.tap(function (file, t) { filename = path.basename(file.path)