-
-
Save vchimev/070882801470d203ca7840b731cb175e to your computer and use it in GitHub Desktop.
NativeScript-Angular HMR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { platformNativeScriptDynamic } from "nativescript-angular/platform"; | |
import { AppOptions } from "nativescript-angular/platform-common"; | |
import { AppModule } from "./app/app.module"; | |
// Optional - attach to livesync hooks and perfrom navigation | |
import "./livesync-navigation"; | |
let options: AppOptions = {}; | |
if (module["hot"]) { | |
options.hmrOptions = { | |
moduleTypeFactory: () => AppModule, | |
livesyncCallback: (platformReboot) => { | |
setTimeout(platformReboot, 0); | |
}, | |
}; | |
// Path to your app module. | |
// You might have to change it if your module is in a different place. | |
module["hot"].accept(["./app/app.module"], () => { | |
global["hmrRefresh"](); | |
}); | |
} | |
// Don't forget to pass the options when creating the platform | |
platformNativeScriptDynamic(options).bootstrapModule(AppModule); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Import on line 4 should be
import
{ AppModule } from"./app/app.module";