File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -313,8 +313,13 @@ exports.Bundle = class {
313
313
}
314
314
315
315
if ( sourceMap && parsedPath ) {
316
- let sourceRoot = parsedPath . dir . slice ( process . cwd ( ) . length + 1 ) ;
317
- sourceMap . sourceRoot = sourceRoot . replace ( / \\ / g, '\/' ) ;
316
+ let sourceRoot = parsedPath . dir . slice ( process . cwd ( ) . length + 1 ) . replace ( / \\ / g, '\/' ) ;
317
+ if ( ! currentFile . dependencyInclusion ) {
318
+ // Deal with local source, only use first top folder.
319
+ // Because gulp-babel/gulp-typescript already had rest of folder in sourceMap sources field.
320
+ sourceRoot = sourceRoot . split ( '/' , 1 ) [ 0 ] ;
321
+ }
322
+ sourceMap . sourceRoot = sourceRoot ;
318
323
needsSourceMap = true ;
319
324
content = Convert . removeMapFileComments ( currentFile . contents ) ;
320
325
}
You can’t perform that action at this time.
0 commit comments