This repository has been archived by the owner on Aug 7, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Angular): add hot loader for lazy loaded NgModules (#747)
## What is the current behavior? In NativeScript Angular the hot updates are only accepted in the entry file (`main.ts`). The lazy loaded NgModules are not directly imported anywhere in the dependency graph with root `main.ts`. That's why the hot updates in lazy modules don't bubble up to the accept in `main.ts` and HMR doesn't work in lazy modules. ## What is the new behavior? Every lazy loaded NgModule is augmented with HMR self-accept during build by the `lazy-ngmodule-hot-loader`. fixes NativeScript/nativescript-angular#1564 BREAKING CHANGES: The `lazy-ngmodule-hot-loader` should be added to the webpack configuration. **BEFORE** ``` js // webpack.config.js { test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/, use: [ "nativescript-dev-webpack/moduleid-compat-loader", "@ngtools/webpack", ] }, // ... ``` **AFTER** ``` js // webpack.config.js { test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/, use: [ "nativescript-dev-webpack/moduleid-compat-loader", "nativescript-dev-webpack/lazy-ngmodule-hot-loader", "@ngtools/webpack", ] }, // ... ```
- Loading branch information