Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SASS: How to remove /*# sourceMappingURL Comment

Tags:

comments

css

sass

I'm starting SASS watch from Windows command line. And FireFox developer Toolbar (with Show Sources) to see the .scss files.

Everything works fine, but I realized my final .css output file was added an extra final line like:

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

As in my company i'm not allowed to leave this comment I'd like to know If I have to manually remove it everytime or is there any way to automatically remove it when I stop SASS Watch.

Issue, other than the manual removal of the line, is that I'm working with Git for version control, so just by starting SASS (--sass watch...) will make my .css file appear as Modified by GIT as the extra line is added (and therefore it shows up in files to be Committed)

like image 321
Barleby Avatar asked Nov 26 '14 09:11

Barleby


Video Answer


1 Answers

What you're seeing is the sourcemap, which maps CSS classes in the compiled CSS to the individual SASS files. As of SASS 3.4, sourcemaps are enabled by default. To disable them, use the --sourcemap=none and that line will no longer be added nor will a sourcemap be generated.

Your command will look something like this:

sass --watch --sourcemap=none path/to/sass:path/to/css
like image 74
allejo Avatar answered Sep 17 '22 11:09

allejo