3

I have custom syntax in some sass files that autoprefixer will error out with. I'd like to run autoprefixer on the source files - excluding the ones with the custom syntax - and then use css-import after that.

Current task:

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/'));
});

I've tried using merge2 and gulp-if but no luck yet. I've also been able to create a temporary folder with the autoprefixed files, but Gulp should have a way to avoid that.

Carson
  • 4,541
  • 9
  • 39
  • 45
  • For what it's worth, I didn't find a solution. Custom syntax parsers are a pain to set up and it wasn't worth it in my situation. – Carson May 04 '17 at 18:53

0 Answers0