supersize
supersize

Reputation: 14773

Disable map files on SASS

I would like to know how I can prevent Sass from writing .map files. I'm using Sass in a very basic setup:

sass --watch style.scss:style.css

what parameters do I have to add to avoid Sass to generate map files?

Upvotes: 61

Views: 46502

Answers (6)

Alan N
Alan N

Reputation: 191

It's now 2023, and the answers here led me to disabling the sourcemaps via PHPStorm 2020.1 and using its File Watchers facility (file/settings/tools/file watchers).

In the Arguments text box, I used the following, and the sourcemaps are now history.

--no-source-map $FileName$:../css/$FileNameWithoutExtension$.css

I hope this may help someone who, like me, was trawling the web for a couple of days for the solution.

Upvotes: 1

Amir M. Mohamadi
Amir M. Mohamadi

Reputation: 1512

As default, the sourcemap is enabled for Dart Sass and if you add --no-source-map it will disable it.

Upvotes: 0

matewka
matewka

Reputation: 10148

That depends on the implementation.

For node-sass and ruby-sass try this:

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

If you're using dart-sass the usage is --no-source-map:

sass --no-source-map --watch style.scss:style.css

Upvotes: 99

Ahmed Kamal
Ahmed Kamal

Reputation: 3000

I'm using sass version 1.13.2 compiled with dart2js 2.0.0 on Ubuntu and it's sass --no-source-map --watch [source].scss:[target].css

as --source-map enables source map and --no-source-map disables it.

Upvotes: 3

Jaisa Ram
Jaisa Ram

Reputation: 1767

it's works:

sass --watch --no-source-map input.scss output.css

with

1.8.0 compiled with dart2js 2.0.0-dev.66.0

Upvotes: 17

Anatolii Pazhyn
Anatolii Pazhyn

Reputation: 1472

Works:

sass --sourcemap=none style.scss style.css

Doesn't work, still generate .map file:

sass --update --sourcemap=none style.scss:style.css

So make sure you have no --update flag

Upvotes: 1

Related Questions