From 536bfa273cdf8f1bf3f45b0a15862cb95bebf272 Mon Sep 17 00:00:00 2001 From: Luke Page Date: Thu, 18 Jul 2013 22:40:59 +0100 Subject: [PATCH] tweaks and start of output --- lib/less/source-map-output.js | 7 +++++-- test/sourcemaps/basic.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/less/source-map-output.js b/lib/less/source-map-output.js index a86c7ec6..b8bd45e2 100644 --- a/lib/less/source-map-output.js +++ b/lib/less/source-map-output.js @@ -39,8 +39,11 @@ tree.sourceMapOutput.prototype.toCSS = function(env) { this._sourceMapGenerator = new sourceMap.SourceMapGenerator({ file:"outputFilenameTODO.css", sourceRoot:"http://blah.com/TODO" }); - for(var filename in this._contentsMap) { - this._sourceMapGenerator.setSourceContent(filename, this._contentsMap[filename]); + //TODO option to include source in sourcemaps? + if (this._outputSourceFiles) { + for(var filename in this._contentsMap) { + this._sourceMapGenerator.setSourceContent(filename, this._contentsMap[filename]); + } } this._rootNode.genCSS(env, this); diff --git a/test/sourcemaps/basic.json b/test/sourcemaps/basic.json index 7191a765..415d3e5a 100644 --- a/test/sourcemaps/basic.json +++ b/test/sourcemaps/basic.json @@ -1 +1 @@ -// ha \ No newline at end of file +{"version":3,"file":"basic.css","sources":["basic.less"],"names":[],"mappings":"EAIE,UAAA;aAJA,QAAA;sBAMA,SAAA","sourceRoot":""} \ No newline at end of file