feat: add output.strictModuleResolution option#21067
Conversation
🦋 Changeset detectedLatest commit: f9a665a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
This PR is packaged and the instant preview is available (437a4c2). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@437a4c2
yarn add -D webpack@https://pkg.pr.new/webpack@437a4c2
pnpm add -D webpack@https://pkg.pr.new/webpack@437a4c2 |
Merging this PR will not alter performance
Comparing Footnotes
|
|
Let's rebase and fix test 👍 |
6d3437e to
d9cfe24
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21067 +/- ##
==========================================
- Coverage 91.97% 91.95% -0.02%
==========================================
Files 581 581
Lines 61206 61207 +1
Branches 16690 16690
==========================================
- Hits 56292 56281 -11
- Misses 4914 4926 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
372805c to
621faac
Compare
|
@hai-x Can you rebase and we can merge 👍 |
621faac to
f9a665a
Compare
|
@alexander-akait Done, let's wait CI to green. |
Summary
What kind of change does this PR introduce?
The runtime missing-module guard (
renderMissingModuleError, which throwsMODULE_NOT_FOUNDwhen a required module id is absent from the bundle) was gated onoutput.pathinfo. That option means "include comments with information about the modules" — it only correlated with the guard because both default todevelopment, so the semantics were wrong.This adds a dedicated
output.strictModuleResolutionboolean that controls the guard directly and defaults todevelopment.Did you add tests for your changes?
Existing
Does this PR introduce a breaking change?
No
If relevant, what needs to be documented once your changes are merged or what have
you already documented?
Document
output.strictModuleResolutionin the output options docs (boolean, defaultsto
development).Use of AI
Yes