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.