I am using a function to determine where the user should be redirected on the loading of the site. Like so:
{ path : '', redirectTo: redirector(), pathMatch: 'full' }
redirector()
returns a route (string) eg: 'home/browse'
This causes the following issue with ng build --prod --aot
Uncaught Error: Invalid configuration of route ''. One of the
following must be provided: component, redirectTo, children or
loadChildren
CanActivate
on the route and put your redirect logic there. It's essentially route middleware.