Use the canonical name for JS modules in node_modules
Closes #438
PiperOrigin-RevId: 239207994
diff --git a/internal/tsc_wrapped/compiler_host.ts b/internal/tsc_wrapped/compiler_host.ts
index 911b82e..e0b2d03 100644
--- a/internal/tsc_wrapped/compiler_host.ts
+++ b/internal/tsc_wrapped/compiler_host.ts
@@ -340,6 +340,10 @@
}
}
+ if (fileName.startsWith('node_modules/')) {
+ return fileName.substring('node_modules/'.length);
+ }
+
// path/to/file ->
// myWorkspace/path/to/file
return path.posix.join(workspace, fileName);