How to use @ngxs/hmr-plugin - 1 common examples

To help you get started, we’ve selected a few @ngxs/hmr-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ngxs / store / integration / main.browser.ts View on Github external
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { BootstrapModuleFn as Bootstrap, hmr, WebpackModule } from '@ngxs/hmr-plugin';

import { AppBrowserModule } from './app/app.browser.module';
import { environment } from './environments/environment';

declare const module: WebpackModule;

if (environment.production) {
  enableProdMode();
}

const bootstrap: Bootstrap = () => platformBrowserDynamic().bootstrapModule(AppBrowserModule);

if (environment.hmr) {
  hmr(module, bootstrap).catch((err: Error) => console.error(err));
} else {
  bootstrap().catch(err => console.log(err));
}

@ngxs/hmr-plugin

HMR plugin for NGXS. See [repo](https://github.com/ngxs/store) for more info.

MIT
Latest version published 5 months ago

Package Health Score

86 / 100
Full package analysis

Popular @ngxs/hmr-plugin functions