move source map output into root directory

This commit is contained in:
Luke Page
2014-08-24 18:50:43 +01:00
parent e325aec74d
commit 5148db6e3d
3 changed files with 8 additions and 8 deletions

View File

@@ -9,6 +9,6 @@ less.Parser = (require('./parser'))(less, less.tree, less.visitor);
less.functions = require('./functions/index.js')(less);
less.contexts = require("./contexts.js");
less.tree.sourceMapOutput = require('./source-map-output.js')(less);
less.SourceMapOutput = require('./source-map-output.js')(less);
module.exports = less;

View File

@@ -515,7 +515,7 @@ var Parser = function Parser(env) {
}
if (options.sourceMap) {
evaldRoot = new tree.sourceMapOutput(
evaldRoot = new less.SourceMapOutput(
{
contentsIgnoredCharsMap: parser.imports.contentsIgnoredChars,
writeSourceMap: options.writeSourceMap,

View File

@@ -1,6 +1,6 @@
module.exports = function (less) {
var sourceMapOutput = function (options) {
var SourceMapOutput = function (options) {
this._css = [];
this._rootNode = options.rootNode;
this._writeSourceMap = options.writeSourceMap;
@@ -24,7 +24,7 @@ module.exports = function (less) {
this._column = 0;
};
sourceMapOutput.prototype.normalizeFilename = function(filename) {
SourceMapOutput.prototype.normalizeFilename = function(filename) {
filename = filename.replace(/\\/g, '/');
if (this._sourceMapBasepath && filename.indexOf(this._sourceMapBasepath) === 0) {
@@ -36,7 +36,7 @@ module.exports = function (less) {
return (this._sourceMapRootpath || "") + filename;
};
sourceMapOutput.prototype.add = function(chunk, fileInfo, index, mapLines) {
SourceMapOutput.prototype.add = function(chunk, fileInfo, index, mapLines) {
//ignore adding empty strings
if (!chunk) {
@@ -92,11 +92,11 @@ module.exports = function (less) {
this._css.push(chunk);
};
sourceMapOutput.prototype.isEmpty = function() {
SourceMapOutput.prototype.isEmpty = function() {
return this._css.length === 0;
};
sourceMapOutput.prototype.toCSS = function(env) {
SourceMapOutput.prototype.toCSS = function(env) {
this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });
if (this._outputSourceFiles) {
@@ -138,5 +138,5 @@ module.exports = function (less) {
return this._css.join('');
};
return sourceMapOutput;
return SourceMapOutput;
};