jgallen23 / grunt-inline-css

Grunt task for turning an html file with linked css to inline css. Great for emails.
MIT License
195 stars 33 forks source link

Target directory / file type instead of file #23

Closed WhatsNewSaes closed 9 years ago

WhatsNewSaes commented 9 years ago

It looks like the only way to get this grunt plugin to work is to manually map the file path. Is there a way to target a directory rather than explicitly defining which files need to be inlined?

Thanks for a great plugin!

files: { '_output/*.html': '_input/*.html' }

instead of files: { '_output/index.html': '_input/index.html' }

enstyled commented 9 years ago

I made it work by setting a files array with "expand: true":

inlinecss: {
    main: {
        files: [
            {
                expand: true,
                src: '*.html',
                dest: './'
            }
        ]
    }
}

Reference: http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically

WhatsNewSaes commented 9 years ago

Thanks!