reducejs / gulp.spritesmith-multi

A wrapper for gulp.spritesmith to generate multiple sprites and stylesheets.
17 stars 7 forks source link

Pipe breaking on error #3

Closed andrey-hohlov closed 8 years ago

andrey-hohlov commented 8 years ago

Hi!

My case:

├── sprites
│   ├── sprite-name
│   │   └── image.png
│   │   └── image@2x.png 

I run watch task. If I add or remove files from srites folder - gulp must run sprites task and create new sprites.

If set retina:true spritesmith need both images (.png and @2x.png) and also look at their dimensions. If there is only one image, or 1x image has size 20*20 and 2x image has size 41*40 - spritesmith throw error and watch task breaks.

If add errorHandler to spritesmth stream (index.js, line 54) , we avoid this:

  var gulpSpriteStream = spritesmith(options)
          .on('error', function (err) {
              console.log(err)
          })

I think it's be better if we will use chalk for painted error message in red.

zoubin commented 8 years ago

@andrey-hohlov This is an important feature for watching. I've propagate the error, you can try the latest release v2.2.2. Check https://github.com/zoubin/gulp.spritesmith-multi#example.

andrey-hohlov commented 8 years ago

Сhecked. Thank you!