Skip to content

Commit 36253f4

Browse files
committed
Simplify internal resolver in dev
1 parent f413446 commit 36253f4

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

.changeset/soft-plants-hope.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Simplify internal resolver in dev

packages/astro/src/core/render/dev/resolve.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ export function createResolve(loader: ModuleLoader, root: URL) {
88
// - /Users/macos/project/src/Foo.vue
99
// - C:/Windows/project/src/Foo.vue (normalized slash)
1010
return async function (s: string) {
11-
const url = await resolveIdToUrl(loader, s, root);
12-
// Vite does not resolve .jsx -> .tsx when coming from hydration script import,
13-
// clip it so Vite is able to resolve implicitly.
14-
if (url.startsWith('/') && url.endsWith('.jsx')) {
15-
return url.slice(0, -4);
16-
} else {
17-
return url;
18-
}
11+
return await resolveIdToUrl(loader, s, root);
1912
};
2013
}

0 commit comments

Comments
 (0)