mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Make HMR work again
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
import 'angular2-universal-polyfills/browser';
|
||||
import 'bootstrap';
|
||||
import './styles/site.css';
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformUniversalDynamic } from 'angular2-universal';
|
||||
import { AppModule } from './app/app.module';
|
||||
|
||||
enableProdMode();
|
||||
platformUniversalDynamic().bootstrapModule(AppModule);
|
||||
// Include styles in the bundle
|
||||
import 'bootstrap';
|
||||
import './styles/site.css';
|
||||
|
||||
// Basic hot reloading support. Automatically reloads and restarts the Angular 2 app each time
|
||||
// you modify source files. This will not preserve any application state other than the URL.
|
||||
declare var module: any;
|
||||
if (module.hot) {
|
||||
module.hot.accept();
|
||||
// Enable either Hot Module Reloading or production mode
|
||||
const hotModuleReplacement = module['hot'];
|
||||
if (hotModuleReplacement) {
|
||||
hotModuleReplacement.accept();
|
||||
hotModuleReplacement.dispose(() => { platform.destroy(); });
|
||||
} else {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
// Boot the application
|
||||
const platform = platformUniversalDynamic();
|
||||
platform.bootstrapModule(AppModule);
|
||||
|
||||
Reference in New Issue
Block a user