This repository was archived by the owner on Mar 19, 2026. It is now read-only.
Repository navigation
fix: use exact regexp filter for virtual module - #89
Merged
Merged
Conversation
commit: |
There was a problem hiding this comment.
Pull Request Overview
This PR updates the module filter matching logic by introducing an exact regex filter for virtual modules.
- Added a new function, exactRegex, in utils.ts to create regexes that match strings exactly.
- Modified filters in modulePreloadPolyfill.ts and wasm.ts to use exactRegex instead of plain string matching.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/vite/src/node/utils.ts | Added exactRegex function to generate regexes using escapeRegex. |
| packages/vite/src/node/plugins/modulePreloadPolyfill.ts | Updated filter option to use exactRegex for modulePreloadPolyfill IDs. |
| packages/vite/src/node/plugins/wasm.ts | Updated filter option to use exactRegex for wasm helper IDs. |
hi-ogawa
marked this pull request as ready for review
March 27, 2025 03:23
Author
|
Hopefully this won't be necessary after #89. |
sapphi-red
approved these changes
Mar 27, 2025
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.
Description
Related rolldown/rolldown#3964, rolldown/rolldown#3970
Probably we shouldn't need to do this, but I'm not sure a way forward, so I think we can use exact regex for the time being.see discussion in rolldown/rolldown#3972Also I wanted to see if this is enough to make build pass on stackblitz and it looks like working now https://stackblitz.com/edit/vitejs-vite-8n2i1q5j?file=package.json&terminal=build