Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile sass / scss without creating map files

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?

like image 860
Willow Avatar asked Jan 20 '16 03:01

Willow


People also ask

Does SCSS need to be compiled?

scss is compiled into CSS when you save your project manually or automatically and how the changes to _grid. scss are reflected in the generated CSS file.

Can I use Sass in SCSS?

When you write Sass code in a . scss file, it is compiled into a regular CSS file that the browser will use to display it on the web page.

Can you use SCSS without Sass?

SASS is used when we need an original syntax, code syntax is not required for SCSS.


2 Answers

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.

like image 57
shender Avatar answered Oct 20 '22 23:10

shender


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

--no-source-map
like image 28
Aldo Ortiz Avatar answered Oct 21 '22 01:10

Aldo Ortiz