Fix pnpm workspace injectRoute bug
See https://github.com/withastro/astro/issues/7561#issuecomment-1620063634 Closes #7561
This commit is contained in:
parent
90e19f8c70
commit
3082c7c269
1 changed files with 2 additions and 2 deletions
|
@ -449,7 +449,7 @@ export function makeAstroPageEntryPointFileName(
|
|||
.replace(prefix, '')
|
||||
.replace(ASTRO_PAGE_EXTENSION_POST_PATTERN, '.');
|
||||
let route = routes.find((routeData) => {
|
||||
return routeData.route === pageModuleId;
|
||||
return routeData.route === pageModuleId || routeData.component === pageModuleId;
|
||||
});
|
||||
let name = pageModuleId;
|
||||
if (route) {
|
||||
|
@ -457,7 +457,7 @@ export function makeAstroPageEntryPointFileName(
|
|||
}
|
||||
if (name.endsWith('/')) name += 'index';
|
||||
const fileName = `${name.replaceAll('[', '_').replaceAll(']', '_').replaceAll('...', '---')}.mjs`;
|
||||
if (name.startsWith('..')) {
|
||||
if (pageModuleId.startsWith('..')) {
|
||||
return `pages${fileName}`;
|
||||
}
|
||||
return fileName;
|
||||
|
|
Loading…
Reference in a new issue