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 'angular2-universal-polyfills/browser';
|
||||||
import 'bootstrap';
|
|
||||||
import './styles/site.css';
|
|
||||||
import { enableProdMode } from '@angular/core';
|
import { enableProdMode } from '@angular/core';
|
||||||
import { platformUniversalDynamic } from 'angular2-universal';
|
import { platformUniversalDynamic } from 'angular2-universal';
|
||||||
import { AppModule } from './app/app.module';
|
import { AppModule } from './app/app.module';
|
||||||
|
|
||||||
enableProdMode();
|
// Include styles in the bundle
|
||||||
platformUniversalDynamic().bootstrapModule(AppModule);
|
import 'bootstrap';
|
||||||
|
import './styles/site.css';
|
||||||
|
|
||||||
// Basic hot reloading support. Automatically reloads and restarts the Angular 2 app each time
|
// Enable either Hot Module Reloading or production mode
|
||||||
// you modify source files. This will not preserve any application state other than the URL.
|
const hotModuleReplacement = module['hot'];
|
||||||
declare var module: any;
|
if (hotModuleReplacement) {
|
||||||
if (module.hot) {
|
hotModuleReplacement.accept();
|
||||||
module.hot.accept();
|
hotModuleReplacement.dispose(() => { platform.destroy(); });
|
||||||
|
} else {
|
||||||
|
enableProdMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Boot the application
|
||||||
|
const platform = platformUniversalDynamic();
|
||||||
|
platform.bootstrapModule(AppModule);
|
||||||
|
|||||||
Reference in New Issue
Block a user