Gulp -ruby-sass sourcemaps not working

It seems I can not get the original layouts and work correctly with gulp -ruby-sass. They generate, and I can see the comment at the end of my css file, but Chrome does not read them, despite the fact that the options are 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']); 
+6
source share
1 answer

API reference doc

  • You need to make sure that you have Sass v3.4.0 or later
  • You need to add sourcemap: true or any other valid value ( auto , file , inline )
  • You need to provide the sourcemapPath that 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/')); }); 
+1
source

Source: https://habr.com/ru/post/978107/


All Articles