Skip to content

Instantly share code, notes, and snippets.

@JurajMlich
Created December 29, 2018 16:37
Show Gist options
  • Save JurajMlich/ff18384685811afedbf3d43b20bb0c2c to your computer and use it in GitHub Desktop.
Save JurajMlich/ff18384685811afedbf3d43b20bb0c2c to your computer and use it in GitHub Desktop.
import {enableProdMode} from '@angular/core';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {AppModule} from './app/app.module';
import {environment} from './environments/environment';
import {hmrModule, bootloader} from '@angularclass/hmr';
if (environment.production) {
enableProdMode();
}
bootloader(() => {
const promise = platformBrowserDynamic().bootstrapModule(AppModule);
if (environment.hmr) {
(<any>module).hot.accept();
promise.then((mod) => {
return hmrModule(mod, <any>module);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment