dbushell / grunt-svg2png

Grunt plugin to rasterize SVG to PNG images using PhantomJS
MIT License
76 stars 37 forks source link

Modified to enabled original src paths to be maintained in destination. #9

Closed morganesque closed 10 years ago

morganesque commented 10 years ago

I wanted the same directory structure to be recreated at destination as was found at the source which I don't think currently happens. I took a look at how svgmin does it and managed to create a solution. It does mean you have to set cwd in the config in order to separate it from the source files.

files: [
    {
        cwd: 'src/img/',
        src: '**/*.svg',
        dest: 'build/img/'
    }
]

It basically uses this.files instead of this.data.files which already has a reference to the globbed files and gives you the ability to then keep the cwd part separate meaning you can then recreate the full directory path in the destination.

Also, I think this will solve the issue which is being talked about here

markgoodyear commented 10 years ago

+1. Using this as I need the original source paths to be maintained. Can confirm it works fine.

averyvery commented 10 years ago

:+1:

thomaswelton commented 10 years ago

:+1: @dbushell are you looking for a maintainer for this project?