-->

Angular 7+: HMR (Hot Module Replacement) does not

2020-02-10 06:23发布

问题:

HMR (Hot Module Replacement) is a great functionality, that works properly if no "Route-resolve" (see below) is present.

If I remove resolve here:

  {
    path: 'new',
    component: BookNewComponent,
    data: {
      breadcrumb: 'book.new.breadcrumb'
    },
    resolve: {
      staticData: StaticDataResolve
    }
  },

HMR is working again. If resolve exists -> HMR reloads the whole app instead of a specific component.

How can I solve this problem?