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?
You're using absolute paths in
gulp.src()andgulp.dest().If your images are located in
D:\Phase Zero\AfterMarket\Application\assets\imagesthen use relative paths instead:gulp.src('assets/images/*.jpg')gulp.dest('assets/images/sprites')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.)