import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { Routes, RouterModule } from '@angular/router'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { StoreModule, MetaReducer } from '@ngrx/store'; import { EffectsModule } from '@ngrx/effects'; // not used in production import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import { storeFreeze } from 'ngrx-store-freeze'; // this would be done dynamically with webpack for builds const environment = { development: true, production: false, }; export const metaReducers: MetaReducer[] = !environment.production ? [storeFreeze] : []; // bootstrap import { AppComponent } from './app.component'; // routes export const ROUTES: Routes = [ { path: '', pathMatch: 'full', redirectTo: 'products' }, { path: 'products', loadChildren: () => import('../products/products.module').then(m => m.ProductsModule) }, ]; @NgModule({ imports: [ BrowserModule, BrowserAnimationsModule, RouterModule.forRoot(ROUTES), StoreModule.forRoot({}, { metaReducers }), EffectsModule.forRoot([]), environment.development ? StoreDevtoolsModule.instrument() : [], ], declarations: [AppComponent], bootstrap: [AppComponent], }) export class AppModule {}