summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Florian Lefebvre <contact@florian-lefebvre.dev> 2024-08-19 20:04:51 +0200
committerGravatar GitHub <noreply@github.com> 2024-08-19 20:04:51 +0200
commitc6400ab99c5e5f4477bc6ef7e801b7869b0aa9ab (patch)
tree61082ad295859369fc714ed971a69032b56015dd
parent826dc2a85aafa26b066c0889eeea493bb6f14b0a (diff)
downloadastro-c6400ab99c5e5f4477bc6ef7e801b7869b0aa9ab.tar.gz
astro-c6400ab99c5e5f4477bc6ef7e801b7869b0aa9ab.tar.zst
astro-c6400ab99c5e5f4477bc6ef7e801b7869b0aa9ab.zip
fix: injectTypes path (#11774)
-rw-r--r--.changeset/odd-donuts-impress.md5
-rw-r--r--packages/astro/src/integrations/hooks.ts4
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),
}),