Fix HMR/Live Reloading when running against webpack v5 and have an array of targets when using webpack-dev-server v3 #3271
+21
−10
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.
For Bugs and Features; did you add new tests?
Updated the existing
addEntries
web targets testMotivation / Use-Case
Since v4 is not out yet (where this issue is fixed) this fixes the live reload issue #2758 that occurs when a user is using webpack v5.
Breaking Changes
None
Additional Info
Tested against the examples and my own private webpack v5 config to confirm that it detected that the config was a web config.
Looking at the fix in the v4 branch I suspect this will not work as well as that change. Specifically if someone uses the new
browserlists
target option this change won't detect that as a web config. Since this change only needs to hold people over until v4 is released I believe its okay since in the example above the user could just addweb
to their target array.