Skip to content

Commit d12031c

Browse files
authored
Support moduleResolution NodeNext and Node16 (#12440)
1 parent 180a120 commit d12031c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/blue-ears-tie.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-router/dev": patch
3+
---
4+
5+
Support `moduleResolution` `Node16` and `NodeNext`

packages/react-router-dev/typegen/generate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function generate(ctx: Context, route: RouteManifestEntry): string {
2222
const indent = i === 0 ? "" : " ".repeat(2);
2323
let source = noExtension(rel);
2424
if (!source.startsWith("../")) source = "./" + source;
25-
return `${indent}import type { Info as Parent${i} } from "${source}"`;
25+
return `${indent}import type { Info as Parent${i} } from "${source}.js"`;
2626
})
2727
.join("\n");
2828

@@ -34,7 +34,7 @@ export function generate(ctx: Context, route: RouteManifestEntry): string {
3434
3535
${parentTypeImports}
3636
37-
type Module = typeof import("../${Pathe.filename(route.file)}")
37+
type Module = typeof import("../${Pathe.filename(route.file)}.js")
3838
3939
export type Info = {
4040
parents: [${parents.map((_, i) => `Parent${i}`).join(", ")}],

0 commit comments

Comments
 (0)