Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory condition to convert images #26

Open
fredw opened this issue Mar 17, 2016 · 1 comment
Open

Directory condition to convert images #26

fredw opened this issue Mar 17, 2016 · 1 comment

Comments

@fredw
Copy link

fredw commented Mar 17, 2016

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.

@dobesv
Copy link

dobesv commented Feb 28, 2017

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants