From 3881901028cbb586f5a4de1b4953e2d6730458ab Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Sat, 18 Mar 2023 17:58:21 +0800 Subject: [PATCH] Simplify internal resolver in dev (#6576) --- .changeset/soft-plants-hope.md | 5 +++++ packages/astro/src/core/render/dev/resolve.ts | 9 +-------- 2 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 .changeset/soft-plants-hope.md diff --git a/.changeset/soft-plants-hope.md b/.changeset/soft-plants-hope.md new file mode 100644 index 000000000000..1268215d31a4 --- /dev/null +++ b/.changeset/soft-plants-hope.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Simplify internal resolver in dev diff --git a/packages/astro/src/core/render/dev/resolve.ts b/packages/astro/src/core/render/dev/resolve.ts index 164333cdcab8..1c8204591b55 100644 --- a/packages/astro/src/core/render/dev/resolve.ts +++ b/packages/astro/src/core/render/dev/resolve.ts @@ -8,13 +8,6 @@ export function createResolve(loader: ModuleLoader, root: URL) { // - /Users/macos/project/src/Foo.vue // - C:/Windows/project/src/Foo.vue (normalized slash) return async function (s: string) { - const url = await resolveIdToUrl(loader, s, root); - // Vite does not resolve .jsx -> .tsx when coming from hydration script import, - // clip it so Vite is able to resolve implicitly. - if (url.startsWith('/') && url.endsWith('.jsx')) { - return url.slice(0, -4); - } else { - return url; - } + return await resolveIdToUrl(loader, s, root); }; }