Answer the question
In order to leave comments, you need to log in
How to change the path of routing chunks in Angular5?
I compile the application ng build --env=dev --aot --deploy-url=/static/
After compiling the page is loaded and the compiled js files are taken from the static folder, but not the pieces for lazy loading, they are taken from /, how can I fix this? routing looks like this:
const appRoutes: Routes = [
{path: '', component: HomeComponent},
{path: 'personal-area', loadChildren: './personal-area/personal-area.module#PersonalAreaModule', canActivate: [AuthGuard]},
{path: 'auth', loadChildren: './auth/auth.module#AuthModule'},
];
@NgModule({
imports: [
RouterModule.forRoot(appRoutes, {preloadingStrategy: PreloadAllModules})
],
exports: [
RouterModule
],
providers: [
AuthGuard,
]
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question