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