javascript - Why does gulp-sprite-generator throw "SyntaxError: Unexpected token ;"? -
running gulp task im getting following error: syntaxerror: unexpected token ;
- im wondering relates in terms of gulp task?
var gulp = require('gulp'); var sprite = require('gulp-sprite-generator'); gulp.task('sprites', function() { var spriteoutput; spriteoutput = gulp.src("src/css/*.css") .pipe(sprite({ baseurl: "src/image/", spritesheetname: "sprite.png", spritesheetpath: "dist/image/" }); spriteoutput.css.pipe(gulp.dest("dist/css/")); spriteoutput.img.pipe(gulp.dest("dist/image/")); }); gulp.task('default', ['sprites']);
i've installed 2 modules mentioned in code. have gulp file in root , created src baseurl
directories. in css dir, have 1 simple .css file following:
#image1 { background: url("../image/banana.png") no-repeat; width: 165px; height: 146px; }
as reference gulp-sprite-generator:
complete error console:
c:\file-path\gulp\gulp-sprite-generator>gulp c:\file-path\gulp\gulp-sprite-generator\gulpf ile.js:12 }); ^ syntaxerror: unexpected token ; @ module._compile (module.js:439:25) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ module.require (module.js:364:17) @ require (module.js:380:17) @ liftoff.handlearguments (c:\npm-path\roaming\npm\node_modules\gu lp\bin\gulp.js:116:3) @ liftoff.<anonymous> (c:\npm-path\roaming\npm\node_modules\gulp\n ode_modules\liftoff\index.js:159:12) @ module.exports (c:\npm-path\roaming\npm\node_modules\gulp\node_m odules\liftoff\node_modules\flagged-respawn\index.js:17:3) @ liftoff.launch (c:\npm-path\roaming\npm\node_modules\gulp\node_m odules\liftoff\index.js:152:5)
it looks missing closing )
on following piece of code.
spriteoutput = gulp.src("src/css/*.css") .pipe(sprite({ baseurl: "src/image/", spritesheetname: "sprite.png", spritesheetpath: "dist/image/" }));
that should sort out error.
Comments
Post a Comment