SASS: How to remove / * # sourceMappingURL Comment

I start SASS chat from the windows command prompt. And the FireFox Developer Toolbar (using Show Sources) to see .scss files.

Everything works fine, but I realized that an additional final line was added to my last output .css file, for example:

/*# sourceMappingURL=index.css.map */ 

As in my company, I cannot leave this comment I would like to know. If I need to manually delete it every time or there is a way to automatically delete it when I stop SASS Watch.

The problem, besides manually deleting the line, is that I work with Git for version control, so just by running SASS (--sass watch ...), my .css file will appear as Modified with Git when an extra line is added ( and therefore it is displayed in files to be committed)

+6
source share
1 answer

What you see is a sourcemap that maps CSS classes in compiled CSS to separate SASS files. Starting with SASS 3.4 , source maps are enabled by default . To disable them, use --sourcemap=none , and this line will no longer be added and the original map will not be created.

Your command will look something like this:

 sass --watch --sourcemap=none path/to/sass:path/to/css 
+5
source

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


All Articles