mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
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(prefix, '')
|
||||||
.replace(ASTRO_PAGE_EXTENSION_POST_PATTERN, '.');
|
.replace(ASTRO_PAGE_EXTENSION_POST_PATTERN, '.');
|
||||||
let route = routes.find((routeData) => {
|
let route = routes.find((routeData) => {
|
||||||
return routeData.route === pageModuleId;
|
return routeData.route === pageModuleId || routeData.component === pageModuleId;
|
||||||
});
|
});
|
||||||
let name = pageModuleId;
|
let name = pageModuleId;
|
||||||
if (route) {
|
if (route) {
|
||||||
|
@ -457,7 +457,7 @@ export function makeAstroPageEntryPointFileName(
|
||||||
}
|
}
|
||||||
if (name.endsWith('/')) name += 'index';
|
if (name.endsWith('/')) name += 'index';
|
||||||
const fileName = `${name.replaceAll('[', '_').replaceAll(']', '_').replaceAll('...', '---')}.mjs`;
|
const fileName = `${name.replaceAll('[', '_').replaceAll(']', '_').replaceAll('...', '---')}.mjs`;
|
||||||
if (name.startsWith('..')) {
|
if (pageModuleId.startsWith('..')) {
|
||||||
return `pages${fileName}`;
|
return `pages${fileName}`;
|
||||||
}
|
}
|
||||||
return fileName;
|
return fileName;
|
||||||
|
|
Loading…
Reference in a new issue