A gulp task for converting images inside a stylesheet to data-URI strings.
npm install --save-dev gulp-image-embed
var gulp = require('gulp');
var embed = require('gulp-image-embed');
//basic
gulp.task('embed', function(){
return gulp.src('*.css')
.pipe(embed({
asset: 'static'
}))
.pipe(gulp.dest('build.css'));
});
//use include
gulp.task('embed', function(){
return gulp.src('*.css')
.pipe(embed({
asset: 'static',
include: [/dataURI/]
}))
.pipe(gulp.dest('build.css'));
});
The path to assets in your project
The extension list
The include list(can has Regexp)
The exclude list(can has Regexp)