Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcemap basepath option #1543

Merged
merged 2 commits into from
Sep 14, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion bin/lessc
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ args = args.filter(function (arg) {
options.sourceMapRootpath = match[2];
}
break;
case 'source-map-basepath':
if (checkArgFunc(arg, match[2])) {
options.sourceMapBasepath = match[2];
}
break;
case 'source-map-inline':
options.outputSourceFiles = true;
break;
Expand Down Expand Up @@ -197,7 +202,7 @@ if (output) {
}
}

options.sourceMapBasepath = process.cwd();
options.sourceMapBasepath = options.sourceMapBasepath || process.cwd();

if (options.sourceMap === true) {
if (!output) {
Expand Down
1 change: 1 addition & 0 deletions lib/less/lessc_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var lessc_helper = {
sys.puts(" format, and 'all' which will do both.");
sys.puts(" --source-map[=FILENAME] Outputs a v3 sourcemap to the filename (or output filename.map)");
sys.puts(" --source-map-rootpath=X adds this path onto the sourcemap filename and less file paths");
sys.puts(" --source-map-basepath=X Sets sourcemap base path, defaults to current working directory.");
sys.puts(" --source-map-inline puts the less files into the map instead of referencing them");
sys.puts(" -rp, --rootpath=URL Set rootpath for url rewriting in relative imports and urls.");
sys.puts(" Works with or without the relative-urls option.");
Expand Down
4 changes: 2 additions & 2 deletions lib/less/source-map-output.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@
this._writeSourceMap(JSON.stringify(this._sourceMapGenerator.toJSON()));

if (this._sourceMapFilename) {
this._css.push("/*# sourceMappingURL=" + this._sourceMapRootpath + this._sourceMapFilename + " */");
this._css.push("/*# sourceMappingURL=" + this.normalizeFilename(this._sourceMapFilename) + " */");
}
}

return this._css.join('');
};

})(require('./tree'));
})(require('./tree'));