Skip to content
Permalink
Browse files

fix(cli-bundler): fix source map path for local source file

closes #1117
  • Loading branch information...
3cp committed Jun 18, 2019
1 parent 112075f commit 7deea6f5218d8ae827853dcf36688565ac7e3104
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/build/bundle.js
@@ -313,8 +313,13 @@ exports.Bundle = class {
}

if (sourceMap && parsedPath) {
let sourceRoot = parsedPath.dir.slice(process.cwd().length + 1);
sourceMap.sourceRoot = sourceRoot.replace(/\\/g, '\/');
let sourceRoot = parsedPath.dir.slice(process.cwd().length + 1).replace(/\\/g, '\/');
if (!currentFile.dependencyInclusion) {
// Deal with local source, only use first top folder.
// Because gulp-babel/gulp-typescript already had rest of folder in sourceMap sources field.
sourceRoot = sourceRoot.split('/', 1)[0];
}
sourceMap.sourceRoot = sourceRoot;
needsSourceMap = true;
content = Convert.removeMapFileComments(currentFile.contents);
}

0 comments on commit 7deea6f

Please sign in to comment.
You can’t perform that action at this time.