support query in ExportsFieldPlugin#225
Merged
sokra merged 2 commits intowebpack:masterfrom Jun 15, 2020
Merged
Conversation
Member
vankop
commented
Jun 9, 2020
- add exports field test cases
- add types export
- add exports field test cases - add types export
Codecov Report
@@ Coverage Diff @@
## master #225 +/- ##
==========================================
- Coverage 95.17% 95.12% -0.05%
==========================================
Files 37 37
Lines 1368 1375 +7
==========================================
+ Hits 1302 1308 +6
- Misses 66 67 +1
Continue to review full report at Codecov.
|
|
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
sokra
requested changes
Jun 9, 2020
lib/ExportsFieldPlugin.js
Outdated
| const remainingRequest = request.query | ||
| ? (request.request === "." ? "./" : request.request) + request.query | ||
| : request.request; | ||
| if (remainingRequest === undefined) return callback(); |
Member
There was a problem hiding this comment.
You should move this line one up to keep the expected behavior
lib/ExportsFieldPlugin.js
Outdated
| paths, | ||
| (p, callback) => { | ||
| const error = checkExportsFieldTarget(p); | ||
| const queryIndex = p.lastIndexOf("?"); |
Member
There was a problem hiding this comment.
Suggested change
| const queryIndex = p.lastIndexOf("?"); | |
| const queryIndex = p.indexOf("?"); |
query string could contain ? itself
| [] | ||
| ] | ||
| }, | ||
| //#endregion |
Member
There was a problem hiding this comment.
add a test case for { "./a?b?c/": "./" } "./a?b?c/d?e?f" -> ./d?e?f
Looks weird I know^^
sokra
approved these changes
Jun 15, 2020
Member
|
Thanks |
graphite-app bot
pushed a commit
to oxc-project/oxc-resolver
that referenced
this pull request
Aug 20, 2025
…ts field (#655) Resolving `package?query#fragment` to packages with exports field is allowed in Vite to allow things like `css-package?url`, `wasm-package?init`. This was not allowed by oxc-resolver and this PR allows that. The current behavior of oxc-resolver comes from this change in enhanced-resolve (webpack/enhanced-resolve#225). This PR adds tests that disallows `pkg?foo` but allows `pkg/nested?foo`. This current behavior doesn't make sense to me. Both `pkg?foo` and `pkg/nested?foo` are not allowed by Node and I don't find a reason to treat them differently. fixes vitejs/rolldown-vite#382 refs 97dfb1a
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.