Grunt-contrib-sass prevents source map

My Grunt setup uses sass to compile my .scss files into src / .css and cssmin to combine and minimize my src / .css files in main.css.

I want to use the new sourcemap function in SASS, but I'm not sure if this will really do anything for me, given that cssmin will put all my css files in main.css.

Can anyone figure this out?

I, too, while trying to disable sourcemap in grunt-contrib-sass, and that won't take. Here is the corresponding code in my Gruntfile.js file:

sass: { dist: { options: { sourcemap: 'none' }, files: [{ expand: true, cwd: 'stylesheets/scss', src: ['**/*.scss'], dest: 'stylesheets/src', ext: '.css' }] } }, 

from: github.com/gruntjs/grunt-contrib-sass

+5
source share
3 answers

I had this problem and other solutions did not help me. Here is how I fixed it:

 options: { "sourcemap=none": '' } 

Using sass version 3.4.2 and npm update did not help

+8
source

I ran into the same problem. As suggested in the @imjared comment above, updating the contribution-watch-trick and grunt-contrib-sass did the trick.

https://www.npmjs.org/doc/cli/npm-update.html

0
source

Adding sourceMap: true as shown below solves the problem for me (NB: I am using grunt.loadNpmTasks ('grunt.sass')):

 sass: { options: { includePaths: ['bower_components/foundation/scss'], imagePath: '/images' }, dist: { options: { outputStyle: 'nested', sourceMap: true }, files: [{ expand: true, cwd: 'scss', src: ['[^_]*.scss'], dest: '../public/css/', ext: '.css' }] } } 

Hope this helps someone.

-3
source

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


All Articles