Is it possible to selectively process css and js assets using gulp-useref based on the build type specified in the html tags?
<!-- build:<type>(alternate search path) <path> -->
... HTML Markup, list of script / link tags.
<!-- endbuild -->
I am interested in differentiating and applying autoprefixing and jslint only to non-vendor assets by specifying different build types for css and css_vendors like below:
index.html
<!-- build:css_vendors css/vendors.min.css -->
<link rel="stylesheet" href="vendor/fontawesome/css/font-awesome.css">
<link rel="stylesheet" href="vendor/magnific-popup/magnific-popup.css">
<!-- endbuild -->
<!-- build:css css/styles.min.css -->
<link rel="stylesheet" href="css/theme.css">
<link rel="stylesheet" href="css/custom.css">
<!-- endbuild -->
gulpfile.js
gulp.task('useref', function() {
return gulp.src('index.html')
.pipe(useref({
css: [ autoprefixer(), minifyCss() ],
css_vendors: [ minifyCss() ]
}))
.pipe(gulp.dest('build/'));
});
Unfortunately, the current gulpfile.js implementation is not functioning as expected.