diff options
-rw-r--r-- | .changeset/odd-donuts-impress.md | 5 | ||||
-rw-r--r-- | packages/astro/src/integrations/hooks.ts | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/.changeset/odd-donuts-impress.md b/.changeset/odd-donuts-impress.md new file mode 100644 index 000000000..7dd8d6b1b --- /dev/null +++ b/.changeset/odd-donuts-impress.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes the path returned by `injectTypes` diff --git a/packages/astro/src/integrations/hooks.ts b/packages/astro/src/integrations/hooks.ts index c0b960433..aa62572ee 100644 --- a/packages/astro/src/integrations/hooks.ts +++ b/packages/astro/src/integrations/hooks.ts @@ -351,7 +351,9 @@ export async function runHookConfigDone({ content: injectedType.content, }); - return new URL(normalizedFilename, settings.config.root); + // It must be relative to dotAstroDir here and not inside normalizeInjectedTypeFilename + // because injectedTypes are handled relatively to the dotAstroDir already + return new URL(normalizedFilename, settings.dotAstroDir); }, logger: getLogger(integration, logger), }), |