2

I have installed gulp-sass and gulp-sourcemaps and I can see there folders in: node_modules.

My gulpfile is here:

var gulp = require('gulp'),
    sass = require('gulp-sass'),
    sourcemaps = require('gulp-sourcemaps');

// Sass Task
gulp.task('sass', function() {
    return gulp.src('src/scss/**/*.scss')
        .pipe(sourcemap.init())
        .pipe(sass({outputStyle:'compact'}).on('error', sass.logError))
        .pipe(sourcemap.write())
        .pipe(gulp.dest('css'));
});

// Watch Task
gulp.task('watch', function(){
    gulp.watch('src/scss/**/*.scss', ['sass']);
});

gulp.task('default', ['sass', 'watch']);

When I run 'gulp watch' and save my scss file I get this error:

ReferenceError: sourcemap is not defined
    at Gulp.<anonymous> (/Users/Chudz/Documents/My Web/Project/gulpfile.js:16:9)
    at module.exports (/Users/Chudz/Documents/My Web/Project/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/Users/Chudz/Documents/My Web/Project/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/Users/Chudz/Documents/My Web/Project/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/Users/Chudz/Documents/My Web/Project/node_modules/orchestrator/index.js:134:8)
    at Gulp.<anonymous> (/Users/Chudz/Documents/My Web/Project/node_modules/gulp/index.js:36:18)
    at Gaze.<anonymous> (/Users/Chudz/Documents/My Web/Project/node_modules/glob-watcher/index.js:18:14)
    at emitTwo (events.js:87:13)
    at Gaze.emit (events.js:172:7)
    at Gaze.emit (/Users/Chudz/Documents/My Web/Project/node_modules/gaze/lib/gaze.js:129:32)

Any ideas where I am going wrong?

Thanks

Chudz
  • 160
  • 2
  • 17

1 Answers1

0

As I posted this I seen the error :) I have sourcemap written a few times instead of sourcemaps

Chudz
  • 160
  • 2
  • 17