diff options
author | 2024-08-19 20:04:51 +0200 | |
---|---|---|
committer | 2024-08-19 20:04:51 +0200 | |
commit | c6400ab99c5e5f4477bc6ef7e801b7869b0aa9ab (patch) | |
tree | 61082ad295859369fc714ed971a69032b56015dd | |
parent | 826dc2a85aafa26b066c0889eeea493bb6f14b0a (diff) | |
download | astro-c6400ab99c5e5f4477bc6ef7e801b7869b0aa9ab.tar.gz astro-c6400ab99c5e5f4477bc6ef7e801b7869b0aa9ab.tar.zst astro-c6400ab99c5e5f4477bc6ef7e801b7869b0aa9ab.zip |
fix: injectTypes path (#11774)
-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), }), |