#Routes work different in --prod and development version

4 messages · Page 1 of 1 (latest)

vale linden
#
  imports: [
    RouterModule.forRoot((window.location.hostname.startsWith('example') ? exampleRoutes: otherRoutes), {
      scrollPositionRestoration: 'enabled',
      onSameUrlNavigation: 'reload'
    })
  ],
  exports: [RouterModule]
})```
#

Running this in development mode works perfectly but running in production this always takes exampleRoutes no matter if the window.location.hostname.startsWith('example') is true or false

#

This overflow question has equivalent problem (has an example)