0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-20 22:12:38 -05:00

fix: injected route entrypoint (#12816)

This commit is contained in:
Emanuele Stoppa 2025-01-02 13:26:55 +00:00 committed by GitHub
parent f12f1118bc
commit 7fb21844df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,7 @@
---
'astro': patch
---
Fixes an issue where an injected route entrypoint wasn't correctly marked because the resolved file path contained a query parameter.
This fixes some edge case where some injected entrypoint were not resolved when using an adapter.

View file

@ -115,7 +115,11 @@ function isInPagesDir(file: URL, config: AstroConfig): boolean {
function isInjectedRoute(file: URL, settings: AstroSettings) {
let fileURL = file.toString();
for (const route of settings.resolvedInjectedRoutes) {
if (route.resolvedEntryPoint && fileURL === route.resolvedEntryPoint.toString()) return true;
if (
route.resolvedEntryPoint &&
removeQueryString(fileURL) === removeQueryString(route.resolvedEntryPoint.toString())
)
return true;
}
return false;
}