This repository was archived by the owner on Sep 4, 2026. It is now read-only.
docs: deprecate the loader and link the migration example - #234
Merged
Conversation
webpack shims these modules without a loader: ProvidePlugin binds a name the module only reads, and the add-imports example does the rest — the side-effect require and the wrapper — with the NormalModule processResult hook, in a plugin that fits in the configuration.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #234 +/- ##
=======================================
Coverage 91.96% 91.96%
=======================================
Files 3 3
Lines 224 224
Branches 87 87
=======================================
Hits 206 206
Misses 12 12
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
webpack shims these modules without a loader:
ProvidePluginbinds a name the module only reads, and the add-imports example does the rest — the side-effect require and thewrapper— with theNormalModule.processResulthook, in a plugin that fits in the configuration. This marks the loader deprecated and adds a per-option migration table pointing there. Depends on webpack/webpack#21948, which adds that example.What kind of change does this PR introduce?
docs — README only, no behavior change.
Did you add tests for your changes?
No; nothing executable changed.
prettierandcspellare clean on the file.Does this PR introduce a breaking change?
No. Whether the loader also starts warning at build time, and when the package gets
npm deprecate, is a separate call.If relevant, what needs to be documented once your changes are merged or what have you already documented?
The webpack.js.org Shimming guide still recommends this loader and should point at the example instead.
Use of AI
Claude Code drafted the notice and the migration table under my direction, and I reviewed it. The table's claims were checked against real builds during the investigation behind webpack/webpack#21948 — including that
ProvidePluginhoists its binding above the module body, so it preserves this loader's ordering.🤖 Generated with Claude Code
https://claude.ai/code/session_01XVjgpHQ9f9sBG3KTdwxAkK
Generated by Claude Code