14

I went looking for this answer and noticed it is not yet on Stack Overflow. So I hope to share this knowledge for anyone in need.

Situation:

In the command line: compiling compressed SASS files from the scss folder into the css folder.

sass --watch scss:css --style compressed

This creates css files, but it also creates .map files as well.

Question:

So how do I stop these .map files from being created?

Willow
  • 1,040
  • 2
  • 10
  • 21

4 Answers4

22

Answer:

Add --sourcemap=none to your command.

So it will look like:

sass --watch scss:css --style compressed --sourcemap=none

Willow
  • 1,040
  • 2
  • 10
  • 21
  • 1
    I know it has been a long time, but what does it impact on SASS? – William Dec 15 '16 at 16:57
  • 2
    @William, do you mean what impact do the map files have? – Willow Dec 18 '16 at 02:37
  • 1
    Yes, and why did you wanted to remove those files in the first place. Id like to know more about SASS – William Dec 18 '16 at 08:29
  • 2
    I remove them because there are so many and they cause conflicts with git. Here is some more information about what they do: http://thesassway.com/intermediate/using-source-maps-with-sass – Willow Dec 19 '16 at 06:07
  • 2
    This answer is no longer valid, see sh78's answer below. (I think you should mention that in your answer too) – Arjun Feb 22 '21 at 13:10
10

Update for 2019

Running --sourcemap-none on the latest version of sass (1.21.0) returns Could not find an option named "sourcemap".

The new flag is --no-source-map.

━━━ Source Maps ━━━━━━━━━━━━━━━━━━━━━━━━
--[no-]source-map          Whether to generate source maps.
                           (defaults to on)

--source-map-urls          How to link from source maps to source files.
                           [relative (default), absolute]

--[no-]embed-sources       Embed source file contents in source maps.
--[no-]embed-source-map    Embed source map contents in CSS.

Also, sass is one of the many CLI programs with built-in help output. Running sass without any arguments shows usage instruction and various flags, like this one.

shender
  • 1,243
  • 13
  • 17
4

Updated command:

sass -w input.scss output.css --style compressed --no-source-map
Peter Csala
  • 17,736
  • 16
  • 35
  • 75
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 14 '21 at 07:38
3

Update, now the proper command to avoid creating a map file is:

--no-source-map
Aldo Ortiz
  • 49
  • 1