Sharad Gupta

Sharad Gupta

  • 92
  • 19.7k
  • 8.5m

Not compile code of angular 5 in prod mode.

Apr 5 2018 1:58 AM
Hi all,
 
I am using this code
  1. import { NgModule, ModuleWithProviders } from '@angular/core';  
  2. import { Routes, RouterModule } from '@angular/router';  
  3. import { MainModule } from './main/main.module';  
  4. import { AuthModule } from './auth/auth.module';  
  5. const routes: Routes = [  
  6. {path: '', redirectTo: 'auth', pathMatch: 'full'},  
  7. {path: 'login' , redirectTo: 'auth' , pathMatch: 'full'},  
  8. {path: 'auth', loadChildren: () => AuthModule }  
  9. ];  
  10. @NgModule({  
  11. imports: [RouterModule.forRoot(routes)],  
  12. exports: [RouterModule],  
  13. })  
  14. export class AppRoutingModule { }  
It works with ng build but did not work with prod mode  'ng build --prod'

Answers (2)