-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.ts
More file actions
31 lines (27 loc) · 969 Bytes
/
main.ts
File metadata and controls
31 lines (27 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import 'moment-timezone';
import 'moment/min/locales.min';
import { environment } from './environments/environment';
import { hmrBootstrap } from './hmr';
import './polyfills.ts';
import { RootModule } from './root.module';
if (environment.production) {
enableProdMode();
}
const bootstrap = () => {
return platformBrowserDynamic().bootstrapModule(RootModule);
};
/* "Hot Module Replacement" is enabled as described on
* https://medium.com/@beeman/tutorial-enable-hrm-in-angular-cli-apps-1b0d13b80130#.sa87zkloh
*/
if (environment.hmr) {
if (module['hot']) {
hmrBootstrap(module, bootstrap); //HMR enabled bootstrap
} else {
console.error('HMR is not enabled for webpack-dev-server!');
console.log('Are you using the --hmr flag for ng serve?');
}
} else {
bootstrap(); //Regular bootstrap
}