0

I just copy pasted the getting started task :

var gulp = require('gulp');
var spritesmith = require('gulp.spritesmith');

gulp.task('sprite', function () {
    console.log("inside sprite");
    var spriteData = gulp.src('/assets/images/*.jpg').pipe(spritesmith({
        imgName: 'sprite.png',
        cssName: 'sprite.css'
    }));

    return spriteData.pipe(gulp.dest('/assets/images/sprites'));
});

When I run this task I get the response :

[19:42:03] Using gulpfile D:\Phase Zero\AfterMarket\Application\gulpfile.js
[19:42:03] Starting 'sprite'...
inside sprite
[19:42:03] Finished 'sprite' after 18 ms

But if I go to '/assets/images/sprites' its empty !

How do I debug here?

Rohit Rane
  • 2,790
  • 6
  • 25
  • 41

1 Answers1

2

You're using absolute paths in gulp.src() and gulp.dest().

  1. If your images are located in D:\Phase Zero\AfterMarket\Application\assets\images then use relative paths instead:

    gulp.src('assets/images/*.jpg')

    gulp.dest('assets/images/sprites')

  2. If your images are actually located in D:\assets\images, try including the drive letter:

    gulp.src('D:/assets/images/*.jpg')

    gulp.dest('D:/assets/images/*.jpg')

    (Disclaimer: I have no idea if this works, never used Gulp on Windows.)

Sven Schoenung
  • 30,224
  • 8
  • 65
  • 70