Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

fix: hmr should work with uglify #953

Merged
merged 1 commit into from
Jun 27, 2019
Merged

Conversation

rosen-vladimirov
Copy link
Contributor

Currently hmr with --env.uglify is not working as the uglifier touches all files. This leads to emit of files that are not hot updates. When CLI finds such files, it decides hmr is not successful and restarts the application.
However, some of the emitted files are not actully changed. These emitted (and not changed) files are chunks of the entry points - as we are with HMR if there's an actual change for them, we'll receive hot-update files.
Currently there's a logic to skip all emitted entry points and webpack runtime files (runtime.js) when we are with HMR. To fix the current issue, extend this logic to skip emitted chunks of entry points as well when we are with HMR and there's no hot-update for them.

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes/Implements/Closes #[Issue Number].

Currently `hmr` with `--env.uglify` is not working as the uglifier touches all files. This leads to emit of files that are not hot updates. When CLI finds such files, it decides hmr is not successful and restarts the application.
However, some of the emitted files are not actully changed. These emitted (and not changed) files are chunks of the entry points - as we are with HMR if there's an actual change for them, we'll receive hot-update files.
Currently there's a logic to skip all emitted entry points and webpack runtime files (`runtime.js`) when we are with HMR. To fix the current issue, extend this logic to skip emitted chunks of entry points as well  when we are with HMR and there's no hot-update for them.
@rosen-vladimirov rosen-vladimirov self-assigned this Jun 27, 2019
@cla-bot cla-bot bot added the cla: yes label Jun 27, 2019
@rosen-vladimirov rosen-vladimirov merged commit 874e4f8 into master Jun 27, 2019
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-hmr-uglify branch June 27, 2019 14:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants