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:
parent
98f9e833a5
commit
a7b37e30e4
2 changed files with 12 additions and 1 deletions
7
.changeset/sour-bananas-rule.md
Normal file
7
.changeset/sour-bananas-rule.md
Normal 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.
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue