Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
基于src有条件地运行gulp任务_Gulp_Tooling_Gulp Autoprefixer - Fatal编程技术网

基于src有条件地运行gulp任务

基于src有条件地运行gulp任务,gulp,tooling,gulp-autoprefixer,Gulp,Tooling,Gulp Autoprefixer,我在一些sass文件中使用了自定义语法,autoprefixer将在其中出错。我希望在源文件上运行autoprefixer(不包括具有自定义语法的文件),然后使用css导入 当前任务: gulp.task('autoprefixer', function() { gulp.src('src/stylesheets/**/*.*') // On all but the following, autoprefix: // - src/stylesheets/file1.scss.

我在一些sass文件中使用了自定义语法,autoprefixer将在其中出错。我希望在源文件上运行autoprefixer(不包括具有自定义语法的文件),然后使用css导入

当前任务:

gulp.task('autoprefixer', function() {
  gulp.src('src/stylesheets/**/*.*')
    // On all but the following, autoprefix:
    // - src/stylesheets/file1.scss.liquid
    // - src/stylesheets/file1.scss.liquid
    .pipe(autoprefixer())

    // On all files not prefaced with underscore, css import
    // - src/stylesheets/[^_]*.*
    .pipe(cssimport())

    // Print to dist/
    .pipe(gulp.dest('dist/'));
});

我试过使用
merge2
gulpif
,但运气不好。我还可以创建一个包含自动刷新文件的临时文件夹,但Gulp应该有办法避免这种情况。

无论如何,我没有找到解决方案。自定义语法分析器设置起来很麻烦,在我的情况下不值得。