gulp-base64 icon indicating copy to clipboard operation
gulp-base64 copied to clipboard

Directory condition to convert images

Open fredw opened this issue 8 years ago • 1 comments

Is there any way to define a condition to only convert urls from a specific directory? Actually I'm using grunt-data-uri plugin from Grunt that allow to define this condition, but I'm starting to use Gulp tasks. The Grunt plugin is configured in this way:

grunt.config('dataUri', {
    default: {
        src: ['public/css/*.css'],
        dest: 'public/css/',
        options: {
            target: ['public/images/inline-data/**']
        }
    }
});

The plugin converts only to base64 the images that are loaded from public/images/inline-data/*. If the image is loaded from a directory different from this, the plugin doesn't replace the url(image) to base64.

fredw avatar Mar 17 '16 14:03 fredw

You could use the exclude regex filter to do this probably, with a regex that matches anything NOT in that folder (e.g. negative lookahead).

dobesv avatar Feb 28 '17 20:02 dobesv