mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
move source map output into root directory
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user