csssassgulpgulp-sass

Output the line number from the SCSS file in compiled CSS with gulp-sass


I've recently switched from Grunt to Gulp task runner.

Is it possible to output as comment the line number in the compiled CSS files that would indicate where a given rule came from in the SASS file?

Such feature was enabled by default when I was using grunt-contrib-compass module.

Now I'm using gulp-sass for compiling my sass files.


Solution

  • Yes it is possible you need to pass it the right options:

    .pipe(sass({
      sourceComments: 'map',
      sourceMap: 'sass',
      outputStyle: 'nested'
    }))