Skip to content

Commit 000c5e8

Browse files
committed
Add path information to source maps. (#8)
1 parent 2a8c35a commit 000c5e8

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ function loader(contents) {
187187
var sourceMap: any;
188188
if (options.sourceMap) {
189189
sourceMap = JSON.parse(output.outputFiles[0].text);
190+
sourceMap.sources = [loaderUtils.getRemainingRequest(this)];
191+
sourceMap.file = loaderUtils.getCurrentRequest(this);
190192
sourceMap.sourcesContent = [contents];
191193
contents = output.outputFiles[1].text;
192194
}

typings/loaderUtils/loaderUtils.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
declare module 'loader-utils' {
22
export function parseQuery<T>(query: string): T;
3+
export function getRemainingRequest(loaderContext: any): any;
4+
export function getCurrentRequest(loaderContext: any): any;
35
}

0 commit comments

Comments
 (0)