From 24d8031bafcd6483fa762ed9ad8437c4a4070093 Mon Sep 17 00:00:00 2001 From: Ron Spickenagel Date: Mon, 4 Dec 2023 20:59:00 -0500 Subject: [PATCH] fix: tsp.currentLibrary was not set (detail) Affects createProgram special instructions & tsExtras --- projects/core/src/patch/patch-module.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/core/src/patch/patch-module.ts b/projects/core/src/patch/patch-module.ts index 7d16890..78a04fc 100644 --- a/projects/core/src/patch/patch-module.ts +++ b/projects/core/src/patch/patch-module.ts @@ -109,10 +109,12 @@ export function patchModule(tsModule: TsModule, skipDts: boolean = false): { js: } /* Get JS */ + const libraryName = tsModule.moduleName.replace(/\.js$/, ''); const patchDetail = PatchDetail.fromModule(tsModule, printedJs); const js = patchDetail.toHeader() + '\n' + jsPatchSrc + '\n' + + `tsp.currentLibrary = '${libraryName}';\n`+ printedJs; return { dts, js };