]>
Commit | Line | Data |
---|---|---|
1 | import { enableProdMode } from '@angular/core' | |
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' | |
3 | ||
4 | import { AppModule } from './app/app.module' | |
5 | import { environment } from './environments/environment' | |
6 | ||
7 | import { hmrBootstrap } from './hmr' | |
8 | ||
9 | if (environment.production) { | |
10 | enableProdMode() | |
11 | } | |
12 | ||
13 | const bootstrap = () => platformBrowserDynamic() | |
14 | .bootstrapModule(AppModule) | |
15 | ||
16 | if (environment.hmr) { | |
17 | if (module[ 'hot' ]) { | |
18 | hmrBootstrap(module, bootstrap) | |
19 | } else { | |
20 | console.error('HMR is not enabled for webpack-dev-server!') | |
21 | console.log('Are you using the --hmr flag for ng serve?') | |
22 | } | |
23 | } else { | |
24 | bootstrap() | |
25 | } |