mirror of
https://github.com/less/less.js.git
synced 2026-01-23 06:07:56 -05:00
added sourceMappingURL option
This commit is contained in:
committed by
Luke Page
parent
5b3b04869b
commit
855eca1d93
@@ -318,6 +318,7 @@ var parseLessFile = function (e, data) {
|
||||
cleancss: options.cleancss,
|
||||
sourceMap: Boolean(options.sourceMap),
|
||||
sourceMapFilename: options.sourceMap,
|
||||
sourceMappingURL: options.sourceMappingURL,
|
||||
sourceMapOutputFilename: options.sourceMapOutputFilename,
|
||||
sourceMapBasepath: options.sourceMapBasepath,
|
||||
sourceMapRootpath: options.sourceMapRootpath || "",
|
||||
|
||||
@@ -469,6 +469,7 @@ less.Parser = function Parser(env) {
|
||||
rootNode: evaldRoot,
|
||||
contentsMap: parser.imports.contents,
|
||||
sourceMapFilename: options.sourceMapFilename,
|
||||
sourceMappingURL: options.sourceMappingURL,
|
||||
outputFilename: options.sourceMapOutputFilename,
|
||||
sourceMapBasepath: options.sourceMapBasepath,
|
||||
sourceMapRootpath: options.sourceMapRootpath,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
this._contentsMap = options.contentsMap;
|
||||
this._sourceMapFilename = options.sourceMapFilename;
|
||||
this._outputFilename = options.outputFilename;
|
||||
this._sourceMappingURL = options.sourceMappingURL;
|
||||
this._sourceMapBasepath = options.sourceMapBasepath;
|
||||
this._sourceMapRootpath = options.sourceMapRootpath;
|
||||
this._outputSourceFiles = options.outputSourceFiles;
|
||||
@@ -93,6 +94,7 @@
|
||||
|
||||
if (this._css.length > 0) {
|
||||
var sourceMapFilename,
|
||||
sourceMappingURL,
|
||||
sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());
|
||||
|
||||
if (this._sourceMapFilename) {
|
||||
@@ -105,8 +107,12 @@
|
||||
sourceMapFilename = "data:application/json," + encodeURIComponent(sourceMapContent);
|
||||
}
|
||||
|
||||
if (sourceMapFilename) {
|
||||
this._css.push("/*# sourceMappingURL=" + sourceMapFilename + " */");
|
||||
if (this._sourceMappingURL) {
|
||||
sourceMappingURL = this.normalizeFilename(this._sourceMappingURL);
|
||||
}
|
||||
|
||||
if (sourceMappingURL || sourceMapFilename) {
|
||||
this._css.push("/*# sourceMappingURL=" + sourceMappingURL || sourceMapFilename + " */");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user