fix(bun): support relative imports without .ts but starting with /u/ or /f/

This commit is contained in:
Ruben Fiszel
2025-11-06 18:42:57 +00:00
parent db045e7d29
commit 9e3ea76575
+6 -1
View File
@@ -32,7 +32,12 @@ const p = {
const imports = transpiler.scanImports(code);
for (const imp of imports) {
if (imp.kind == "import-statement") {
if (imp.path.startsWith(".") && !imp.path.endsWith(".ts")) {
if (
(imp.path.startsWith(".") ||
imp.path.startsWith("/u/") ||
imp.path.startsWith("/f/")) &&
!imp.path.endsWith(".ts")
) {
code = code.replaceAll(imp.path, imp.path + ".ts");
}
}