Skip to content

feat(pluginutils): add suffixRegex & support multiple string #1886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

btea
Copy link
Contributor

@btea btea commented Jul 26, 2025

Rollup Plugin Name: {pluginutils}

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

To reduce unnecessary interactions between js and rust when executing plugins, rolldown expands the plugin hook into an object containing filter properties. doc

Rollup also supports this feature in version 4.38.0. rollup/rollup#5882

In order to facilitate the generation of filter condition parameters, #1865 added several auxiliary functions.

When I was refactoring the filtering conditions of vite's internal plugins, I found that some plugins' filtering often consisted of multiple conditions. In this case, it would be more convenient for functions such as prefixRegex/exactRegex to support passing in multiple strings. Therefore, I expanded the parameters.

At the same time, I found that some plug-ins are more suitable for file suffix matching, such as .vue, so I added a new suffixRegex function to facilitate this situation.

@btea btea requested a review from shellscape as a code owner July 26, 2025 09:34
@shellscape
Copy link
Collaborator

I'm not inclined to review this without a thorough PR description.

@btea
Copy link
Contributor Author

btea commented Jul 26, 2025

Sorry, I have updated the description. Please review it at your convenience. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants