twolfson / grunt-spritesmith

Grunt task for converting a set of images into a spritesheet and corresponding CSS variables
MIT License
1.14k stars 92 forks source link

No "sprite" targets found. #150

Closed douglasdeodato closed 9 years ago

douglasdeodato commented 9 years ago

after run : grunt sprite, i got this.

all folders and files exists and are there, any help?

my grunt:

/sprite min =============================== var spritesmith; config.spritesmith = spritesmith = {};

              // Configure grunt
              grunt.initConfig({
                sprite:{
                  all: {
                    src: 'public/images/*.png',
                    dest: 'public/images/sprite/spritesheet.png',
                    destCss: 'sass/sprites.css'
                  }
                }
              });
twolfson commented 9 years ago

Can you paste your entire Gruntfile.js and the command you are running?

douglasdeodato commented 9 years ago

hi, thanks for your answer, that is my full gruntfile.js

i am getting that error now: Fatal error: grunt.sprite requires a src, dest (img), and destCss property

https://gist.github.com/douglasdeodato/2137804a38ca1bc42f72

thank you.

twolfson commented 9 years ago

You are writing in too many layers of nesting for your config. Instead of sprite.dist, it should be sprite.all (or only sprite.dist):

var sprite;
config.sprite = sprite = {};

// Configure grunt 
sprite.dist ={
  src: 'public/images/*.png',
  dest: 'public/images/sprite/spritesheet.png',
  destCss: 'sass/sprites.css'
};
douglasdeodato commented 9 years ago

thanks a lot, solved.

kalburgimanjunath commented 7 years ago

I am trying to generate svg its throwing an error,any help?

sprite: { all: { src: 'assets/svg/*.svg', dest: 'assets/test.svg', destCss: 'assets/sprites.css' } }

Fatal error: Unsupported file type: image/svg+xml

twolfson commented 7 years ago

@kalburgimanjunath That is an unrelated error message/issue. spritesmith only supports bitmap images (e.g. png, gif, jpg) -- you'll likely want an SVG sprite library. If you have further questions, please open another issue