File tree 2 files changed +4
-6
lines changed
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export default defineNuxtModule({
75
75
return true
76
76
}
77
77
78
- const pages = await resolvePagesRoutes ( )
78
+ const pages = await resolvePagesRoutes ( nuxt )
79
79
if ( pages . length ) {
80
80
if ( nuxt . apps . default ) {
81
81
nuxt . apps . default . pages = pages
@@ -93,7 +93,7 @@ export default defineNuxtModule({
93
93
}
94
94
95
95
nuxt . hook ( 'app:templates' , async ( app ) => {
96
- app . pages = await resolvePagesRoutes ( )
96
+ app . pages = await resolvePagesRoutes ( nuxt )
97
97
98
98
if ( ! nuxt . options . ssr && app . pages . some ( p => p . mode === 'server' ) ) {
99
99
logger . warn ( 'Using server pages with `ssr: false` is not supported with auto-detected component islands. Set `experimental.componentIslands` to `true`.' )
@@ -173,7 +173,7 @@ export default defineNuxtModule({
173
173
logs : nuxt . options . debug ,
174
174
async beforeWriteFiles ( rootPage ) {
175
175
rootPage . children . forEach ( child => child . delete ( ) )
176
- const pages = nuxt . apps . default ?. pages || await resolvePagesRoutes ( )
176
+ const pages = nuxt . apps . default ?. pages || await resolvePagesRoutes ( nuxt )
177
177
if ( nuxt . apps . default ) {
178
178
nuxt . apps . default . pages = pages
179
179
}
Original file line number Diff line number Diff line change @@ -42,9 +42,7 @@ interface ScannedFile {
42
42
absolutePath : string
43
43
}
44
44
45
- export async function resolvePagesRoutes ( ) : Promise < NuxtPage [ ] > {
46
- const nuxt = useNuxt ( )
47
-
45
+ export async function resolvePagesRoutes ( nuxt = useNuxt ( ) ) : Promise < NuxtPage [ ] > {
48
46
const pagesDirs = nuxt . options . _layers . map (
49
47
layer => resolve ( layer . config . srcDir , ( layer . config . rootDir === nuxt . options . rootDir ? nuxt . options : layer . config ) . dir ?. pages || 'pages' ) ,
50
48
)
You can’t perform that action at this time.
0 commit comments