In my dev build in my angular project, In the child module's routing file I am doing something like below,
const routes = window.innerWidth > 768 ? desktopRoutes: mobileRoutes;
Then I am passing these routes to RouterModule.forChild(routes)
The dev build works like a charm, however, when I create a prod build and deploy it, this thing fails to work and only loads the mobileRoutes, Irrespective of the screen resolution.
Any suggestions or alternatives I should look into are welcome
Note: that desktop route components extend Mobile components, just adding the info if that helps!