Menu

#2394 sourceMap option documentation is inaccurate

open
nobody
None
2018-05-24
2018-05-24
Anonymous
No

Originally created by: nex3

The documentation for the sourceMap option claims that

Setting the sourceMap option requires also setting the outFile option

However, in practice, if you set sourceMap to a string and don't set outFile, you still get a map buffer in the result. For example:

var sass = require('node-sass');

var result = sass.renderSync({
  data: 'a {b: c}',
  sourceMap: 'out.css.map'
});
console.log(result.map.toString());

prints

{
        "version": 3,
        "file": "stdin.css",
        "sources": [
                "stdin"
        ],
        "names": [],
        "mappings": "AAAA,AAAA,CAAC,CAAC;EAAC,CAAC,EAAE,CAAC,GAAE"
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.