Skip to content

Commit

Permalink
Fixes less#2987, --source-map-map-inline works as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico Schoenmaker committed Nov 16, 2016
1 parent cc1a143 commit bd37543
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bin/lessc
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,14 @@ function printUsage() {
return;
}
// its in the same directory, so always just the basename
sourceMapOptions.sourceMapOutputFilename = path.basename(output);
sourceMapOptions.sourceMapFullFilename = output + ".map";
if (output) {
sourceMapOptions.sourceMapOutputFilename = path.basename(output);
sourceMapOptions.sourceMapFullFilename = output + ".map";
}
// its in the same directory, so always just the basename
sourceMapOptions.sourceMapFilename = path.basename(sourceMapOptions.sourceMapFullFilename);
if ('sourceMapFullFilename' in sourceMapOptions) {
sourceMapOptions.sourceMapFilename = path.basename(sourceMapOptions.sourceMapFullFilename);
}
} else if (options.sourceMap && !sourceMapFileInline) {
var mapFilename = path.resolve(process.cwd(), sourceMapOptions.sourceMapFullFilename),
mapDir = path.dirname(mapFilename),
Expand All @@ -331,7 +335,7 @@ function printUsage() {
}

if (sourceMapOptions.sourceMapRootpath === undefined) {
var pathToMap = path.dirname(sourceMapFileInline ? output : sourceMapOptions.sourceMapFullFilename || '.'),
var pathToMap = path.dirname((sourceMapFileInline ? output : sourceMapOptions.sourceMapFullFilename) || '.'),
pathToInput = path.dirname(sourceMapOptions.sourceMapInputFilename || '.');
sourceMapOptions.sourceMapRootpath = path.relative(pathToMap, pathToInput);
}
Expand Down

0 comments on commit bd37543

Please sign in to comment.