fix: don't restart application when lazy loaded code is changed in angular app with uglify option #4786
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently CLI has a logic to restart the application when one or more of the emitted files from webpack compilation is not hot update. When a lazy loaded code is changed in angular application and uglify option is provided, CLI always restarts the application. (as 0.js, 1.js are reported as changed). This happens due to the fact that CLI omits entry point files and runtime files from emitted files to check if all rest files are hot updates. As the lazy loaded chunks (
0.js
,1.js
) are neither entry point files nor runtime files, they are not omitted and CLI decides that there is file that is not hot update and restarts the application. This PR changes this behavior and respects only chunk files from webpack compilation. Chunk files are all files except hot update files. Chunk files are:runtime.js
,tns_modules/inspector-modules.js
,bundle.js
,vendor.js
and all lazy loaded modules in other words runtime files + entry point files + splitted files from compilation + lazy loaded files for angular.PR Checklist
What is the current behavior?
What is the new behavior?
Fixes/Implements/Closes #[Issue Number].