svg-sprite / grunt-svg-sprite

SVG sprites & stacks galore — Grunt plugin wrapping around svg-sprite that reads in a bunch of SVG files, optimizes them and creates SVG sprites and CSS resources in various flavours

Home Page:https://github.com/svg-sprite/svg-sprite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Task done, but without sprite svg

stephane-r opened this issue · comments

Hi,

I test your plugin for generate svg sprite, but after start task svg_sprite, I have no output file.

My code :

svg_sprite                  : {
    basic                   : {

        // Target basics
        expand              : true,
        cwd                 : 'images/svg/*.svg',
        src                 : ['images/svg/*.svg'],
        dest                : 'out'
    }
}

I've 'images/svg' folders with my all icons svg.

Can you help me ?

Thank you :)

Hi @Leg3ndz,

without having tested it: You should get rid of that *.svg in your cwd setting ("current working directory"). Please let me know if that works for you.

Cheers,
Joschi

Yop,

Thak you for response. I've test without "*.svg", but no result :

svg_sprite : {
    basic : {
        expand              : true,
        cwd                 : 'images/svg',
        src                 : ['images/svg/*.svg'],
        dest                : 'out'
    }
}

My svg files is all on "/images/svg/". Out folder does not create after task.

Ok, seems like there's still an error that I didn't spot in the first place. Please have a look at the example config from the docs:

your_target: {
    expand      : true,
    cwd         : 'path/to/assets',
    src         : ['**/*.svg'],
    dest        : 'path/to/css/dir',
    options     : {
        // Target-specific options
    }
},

The cwd setting specifies the working directory, while the src settings specifies the glob within the cwd. So your setup would look for SVGs like images/svg/images/svg/*.svg. Please modify your src setting accordingly.

Cheers,
Joschi

Hi @Leg3ndz,

did you have the chance to test this again with a corrected svg setting? Any progress on this? Thanks!

Cheers, Joschi

Hi @jkphl

Yep, with your past post, it's okay :)

Thank you !

Good to know, and glad it works for you! Cheers!