@@ -2,7 +2,7 @@ import { runInNewContext } from 'node:vm'
2
2
import fs from 'node:fs'
3
3
import { extname , normalize , relative , resolve } from 'pathe'
4
4
import { encodePath , joinURL , withLeadingSlash } from 'ufo'
5
- import { logger , resolveFiles , useNuxt } from '@nuxt/kit'
5
+ import { logger , resolveFiles , resolvePath , useNuxt } from '@nuxt/kit'
6
6
import { genArrayFromRaw , genDynamicImport , genImport , genSafeVariableName } from 'knitwork'
7
7
import escapeRE from 'escape-string-regexp'
8
8
import { filename } from 'pathe/utils'
@@ -142,7 +142,7 @@ export function generateRoutesFromFiles (files: ScannedFile[], options: Generate
142
142
export async function augmentPages ( routes : NuxtPage [ ] , vfs : Record < string , string > , augmentedPages = new Set < NuxtPage > ( ) ) {
143
143
for ( const route of routes ) {
144
144
if ( ! augmentedPages . has ( route ) && route . file ) {
145
- const fileContent = route . file in vfs ? vfs [ route . file ] : fs . readFileSync ( route . file , 'utf-8' )
145
+ const fileContent = route . file in vfs ? vfs [ route . file ] : fs . readFileSync ( await resolvePath ( route . file ) , 'utf-8' )
146
146
Object . assign ( route , await getRouteMeta ( fileContent , route . file ) )
147
147
}
148
148
0 commit comments