From 733997a780e260208d2f34d2d52684ee4f71d734 Mon Sep 17 00:00:00 2001 From: iFaxity Date: Mon, 4 Apr 2022 00:10:52 +0200 Subject: [PATCH] fix: Replaced reference id with this.getFilename() to get accurate filenames --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e02710b..967a996 100644 --- a/src/index.ts +++ b/src/index.ts @@ -122,8 +122,9 @@ export = function istanbulPlugin(opts: IstanbulPluginOptions = {}): Plugin { } if (exclude.shouldInstrument(id)) { + const filename = this.getFileName(id); const sourceMap = sanitizeSourceMap(this.getCombinedSourcemap()); - const code = instrumenter.instrumentSync(srcCode, id, sourceMap); + const code = instrumenter.instrumentSync(srcCode, filename, sourceMap); const map = instrumenter.lastSourceMap(); // Required to cast to correct mapping value