angular universal Prerender - ignoring some Routes in the routes file

612 Views Asked by At

i want to make Prerendring with angular universal . th problem is the Prendring is ignoring the home routes and i didn't know why ??

this my app.routing Module section:

   RouterModule.forRoot([
   {
     path: '',
     loadChildren: () => import('@test- 
     front/shared/container').then((m)=>m.SharedContainerModule),
   },
   {
     path:'mobileFilter',
     component:MobileFilterComponent
   }

]),

this is the shared Container Routing:

  RouterModule.forChild([
          {
            path:'', component: ContainerComponent,
            children:[
              {
                path:'',redirectTo:'home', pathMatch:'full'
              },
              {
                path:'home',
                loadChildren: ()=> import('@test- 
                front/home').then((m)=>m.HomeModule)
              },
              {
                path: 'product',
                loadChildren: () => import('@test- 
                front/catalog').then((m)=>m.CatalogModule),
              },

      ],

the problem is i don't know why he is ignoring the home path when i try to run npm run prender this is the package.json

   "serve:prerender": "http-server -c-1 dist/cycle-up/browser ",
   "prerender": "ng run cycle-up:prerender  --routesFile routes.txt",

this is the ouput of npm run prender there is no home folder

enter image description here

this is the routes.txt file

       /home/
      /product/detail
 
0

There are 0 best solutions below