Skip to content
This repository was archived by the owner on Mar 19, 2026. It is now read-only.

fix: use exact regexp filter for virtual module - #89

Merged
hi-ogawa merged 3 commits into
vitejs:rolldown-vitefrom
hi-ogawa:fix-string-hook-filter
Mar 27, 2025
Merged

hi-ogawa merged 3 commits into
vitejs:rolldown-vitefrom
hi-ogawa:fix-string-hook-filter

Conversation

@hi-ogawa

@hi-ogawa hi-ogawa commented Mar 27, 2025 •

Copy link
Copy Markdown

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#3972

Also 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

@pkg-pr-new

pkg-pr-new Bot commented Mar 27, 2025 •

Copy link
Copy Markdown

Open in Stackblitz

npm i https://pkg.pr.new/vitejs/rolldown-vite@89

commit: 9c7889f

@hi-ogawa
hi-ogawa requested a review from Copilot March 27, 2025 03:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
hi-ogawa marked this pull request as ready for review March 27, 2025 03:23
@hi-ogawa

Copy link
Copy Markdown
Author

Hopefully this won't be necessary after #89.

@hi-ogawa
hi-ogawa merged commit fbbfca4 into vitejs:rolldown-vite Mar 27, 2025
@hi-ogawa
hi-ogawa deleted the fix-string-hook-filter branch March 27, 2025 08:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants