@@ -25,34 +25,32 @@ export const setupRouter = () => {
2525 nuxt . options . vite . optimizeDeps . include = nuxt . options . vite . optimizeDeps . include || [ ]
2626 nuxt . options . vite . optimizeDeps . include . push ( '@ionic/vue-router' )
2727
28- nuxt . hook ( 'modules:done' , ( ) => {
29- nuxt . options . plugins = nuxt . options . plugins . filter (
30- p =>
31- ! ( typeof p === 'string' ? p : p . src ) . endsWith ( 'nuxt/dist/pages/runtime/router' ) &&
32- ! ( typeof p === 'string' ? p : p . src ) . endsWith ( 'nuxt/dist/app/plugins/router' )
28+ nuxt . hook ( 'app:resolve' , app => {
29+ app . plugins = app . plugins . filter (
30+ p => ! p . src . match ( / n u x t 3 ? \/ d i s t \/ ( a p p \/ p l u g i n s | p a g e s \/ r u n t i m e ) \/ r o u t e r / )
3331 )
32+ } )
3433
35- // Add all pages to be prerendered
36- const routes : string [ ] = [ ]
34+ // Add all pages to be prerendered
35+ const routes : string [ ] = [ ]
3736
38- nuxt . hook ( 'pages:extend' , pages => {
39- routes . length = 0
40- routes . push ( '/' , ...( ( nuxt . options . nitro . prerender ?. routes || [ ] ) as string [ ] ) )
41- function processPages ( pages : NuxtPage [ ] , currentPath = '' ) {
42- for ( const page of pages ) {
43- if ( page . path . includes ( ':' ) ) continue
37+ nuxt . hook ( 'pages:extend' , pages => {
38+ routes . length = 0
39+ routes . push ( '/' , ...( ( nuxt . options . nitro . prerender ?. routes || [ ] ) as string [ ] ) )
40+ function processPages ( pages : NuxtPage [ ] , currentPath = '' ) {
41+ for ( const page of pages ) {
42+ if ( page . path . includes ( ':' ) ) continue
4443
45- const path = joinURL ( currentPath , page . path )
46- routes . push ( path )
47- if ( page . children ) processPages ( page . children , path )
48- }
44+ const path = joinURL ( currentPath , page . path )
45+ routes . push ( path )
46+ if ( page . children ) processPages ( page . children , path )
4947 }
50- processPages ( pages )
51- } )
48+ }
49+ processPages ( pages )
50+ } )
5251
53- nuxt . hook ( 'nitro:build:before' , nitro => {
54- nitro . options . prerender . routes = routes
55- } )
52+ nuxt . hook ( 'nitro:build:before' , nitro => {
53+ nitro . options . prerender . routes = routes
5654 } )
5755
5856 // Remove vue-router types
0 commit comments