mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
bin/lessc: Make sure path.dirname gets passed strings
Since nodejs/node@08085c49b6, which will be part of Node.js v6.0, functions from the `path` core module (like `dirname`) will require the input to be a string. Because `.sourceMapFullFilename` and `.sourceMapInputFilename` in bin/lessc may be `undefined`, default to passing `'.'` to `path.dirname` instead.
This commit is contained in:
@@ -316,8 +316,8 @@ function printUsage() {
|
||||
}
|
||||
|
||||
if (sourceMapOptions.sourceMapRootpath === undefined) {
|
||||
var pathToMap = path.dirname(sourceMapFileInline ? output : sourceMapOptions.sourceMapFullFilename),
|
||||
pathToInput = path.dirname(sourceMapOptions.sourceMapInputFilename);
|
||||
var pathToMap = path.dirname(sourceMapFileInline ? output : sourceMapOptions.sourceMapFullFilename || '.'),
|
||||
pathToInput = path.dirname(sourceMapOptions.sourceMapInputFilename || '.');
|
||||
sourceMapOptions.sourceMapRootpath = path.relative(pathToMap, pathToInput);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user