0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

fix: injected route entrypoint

This commit is contained in:
Emanuele Stoppa 2024-12-23 12:17:32 +00:00
parent 98f9e833a5
commit a7b37e30e4
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;
}