improve some of the source map options

This commit is contained in:
Luke Page
2014-10-19 21:00:19 +01:00
parent 65702f80a3
commit e02449b656

View File

@@ -292,9 +292,11 @@ if (options.sourceMap) {
}
}
sourceMapOptions.sourceMapBasepath = sourceMapOptions.sourceMapBasepath || (input ? path.dirname(input) : process.cwd());
if (sourceMapOptions.sourceMapBasepath === undefined) {
sourceMapOptions.sourceMapBasepath = input ? path.dirname(input) : process.cwd();
}
if (!sourceMapOptions.sourceMapRootpath) {
if (sourceMapOptions.sourceMapRootpath === undefined) {
var pathToMap = path.dirname(sourceMapFileInline ? output : sourceMapOptions.sourceMapFullFilename),
pathToInput = path.dirname(sourceMapOptions.sourceMapInputFilename);
sourceMapOptions.sourceMapRootpath = path.relative(pathToMap, pathToInput);