gobwas / gulp-sprite-generator

Plugin that generate sprites from your stylesheets.
42 stars 16 forks source link

Doesn't seem to work well with gulp-rev #1

Closed rmanalan closed 10 years ago

rmanalan commented 10 years ago

Here's my task...

gulp.task('styles', function() {
  var output;
  output = gulp.src(paths.styles)
    .pipe(less())
    .pipe(sprite({
      baseUrl: './',
      spriteSheetName: 'sprite.png',
      spriteSheetPath: './assets/img',
      styleSheetName: 'app.css'
    }))
  output.css
    .pipe(gulpif(isProduction, rev()))
    .pipe(gulp.dest(destdir))
    .pipe(gulpif(isProduction, rev.manifest()))
    .pipe(gulpif(isProduction, rename('css-manifest.json')))
    .pipe(gulpif(isProduction, gulp.dest(destdir)))
  output.img
    .pipe(gulp.dest(destdir + '/assets/img'));
});

The problem is when you call .pipe(gulpif(isProduction, rev.manifest())). For some reason, sprite-generator's pipe isn't calling through2's flushFn which rev.manifest() seems to rely on to be triggered. This causes the manifest to never be written out.

gobwas commented 10 years ago

Yep, got it. Will fix it soon. If you have a ready solution - make pull request =)

gobwas commented 10 years ago

@rmanalan Hi! Seems it works for me now. Can you check it from 0.2.0 branch?

gobwas commented 10 years ago

@rmanalan ping =)

rmanalan commented 10 years ago

Works! Sorry for the delay.