Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gulp-ruby-sass sourcemaps not working

I can't seem to get my sourcemaps up and working correctly with gulp-ruby-sass. They generate, and I can see the comment at the end of my css file, but Chrome doesn't read them despite options being enabled in the settings.

Thanks for any help,

var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-ruby-sass');

gulp.task('sass', function(){
  gulp.src('./assets/scss/main.scss')
      .pipe(sass({noCache: true, sourcemapPath: '../scss'}))
      .on('error', function(err){console.log(err.message);})
      .pipe(gulp.dest('./assets/css/'));
});

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

gulp.task('default', ['sass','watch']);
like image 272
christian Avatar asked Nov 12 '14 19:11

christian


1 Answers

Refering to the API doc

  • You need to make sure you have Sass v3.4.0 or newer
  • You need to add sourcemap: true or any other valid value (auto, file, inline)
  • You need to provide a sourcemapPath, which you already have
gulp.task('sass', function(){
  gulp.src('./assets/scss/main.scss')
      .pipe(sass({
        noCache: true, 
        sourcemapPath: '../scss',
        sourcemap: true
      }))
      .on('error', function(err){console.log(err.message);})
      .pipe(gulp.dest('./assets/css/'));
});
like image 130
Jérémie Parker Avatar answered Nov 15 '22 20:11

Jérémie Parker