mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
fix: check key correctly
This commit is contained in:
parent
a7dde60be2
commit
9dea206001
@ -142,10 +142,11 @@ export function generateRoutesFromFiles (files: ScannedFile[], options: Generate
|
|||||||
|
|
||||||
export async function augmentPages (routes: NuxtPage[], vfs: Record<string, string>, augmentedPagesWithPaths = new Set<string>(), parentPath = '') {
|
export async function augmentPages (routes: NuxtPage[], vfs: Record<string, string>, augmentedPagesWithPaths = new Set<string>(), parentPath = '') {
|
||||||
for (const route of routes) {
|
for (const route of routes) {
|
||||||
if (route.file && !augmentedPagesWithPaths.has(route.file)) {
|
const key = `${route.file}_${parentPath}${route.path}`
|
||||||
|
if (route.file && !augmentedPagesWithPaths.has(key)) {
|
||||||
const fileContent = route.file in vfs ? vfs[route.file] : fs.readFileSync(await resolvePath(route.file), 'utf-8')
|
const fileContent = route.file in vfs ? vfs[route.file] : fs.readFileSync(await resolvePath(route.file), 'utf-8')
|
||||||
Object.assign(route, await getRouteMeta(fileContent, route.file))
|
Object.assign(route, await getRouteMeta(fileContent, route.file))
|
||||||
augmentedPagesWithPaths.add(`${route.file}_${parentPath}${route.path}`)
|
augmentedPagesWithPaths.add(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (route.children && route.children.length > 0) {
|
if (route.children && route.children.length > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user