fix: check for name of HotModuleReplacementPlugin to avoid RangeError#2146
Merged
alexander-akait merged 3 commits intowebpack:masterfrom Jul 27, 2019
Merged
fix: check for name of HotModuleReplacementPlugin to avoid RangeError#2146alexander-akait merged 3 commits intowebpack:masterfrom
alexander-akait merged 3 commits intowebpack:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2146 +/- ##
=======================================
Coverage 92.56% 92.56%
=======================================
Files 33 33
Lines 1265 1265
Branches 361 361
=======================================
Hits 1171 1171
Misses 87 87
Partials 7 7
Continue to review full report at Codecov.
|
hiroppy
approved these changes
Jul 24, 2019
wizardofhogwarts
approved these changes
Jul 27, 2019
knagaitsev
pushed a commit
to knagaitsev/webpack-dev-server
that referenced
this pull request
Jul 31, 2019
This was referenced Dec 14, 2019
This was referenced Feb 22, 2020
This was referenced Mar 13, 2020
This was referenced May 5, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Yes
Motivation / Use-Case
Fixes #87, a long-standing subtle bug which seems to have tripped up a lot of people historically.
Breaking Changes
No breaking changes.
Additional Info
See my comment on the issue: #87 (comment). The only way I can see this solution being a problem is if we're worried about configs that are using
--hotand also have a plugin that isn'tHotModuleReplacementPluginbut has the same name. In that case, we'd no longer inject the real HMR plugin. I'm not sure how likely this is and I seem to remember seeing other webpack plugins that check the name string rather than relying on the constructor reference (probably for this same reason).However, if we are concerned and if there's a property we can additionally check on the instances of the plugin, that would potentially be more robust. Ideally it'd be a property that's existing on the
HotModuleReplacementPluginfor a while to make it as backward-compatible as possible.