-
-
Notifications
You must be signed in to change notification settings - Fork 141
feat: add filter #470
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
base: main
Are you sure you want to change the base?
feat: add filter #470
Conversation
: undefined, | ||
resolveId: { | ||
filter: { id: exactRegex(runtimePublicPath) }, | ||
handler: (id) => (id === runtimePublicPath ? id : undefined), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to keep the if
statements to keep the compat for Vite older than v6.3.
id: { | ||
include: ensureArray(include).map(matchWithQuery), | ||
exclude: [ | ||
...(exclude ? ensureArray(exclude).map(matchWithQuery) : []), | ||
/\/node_modules\//, | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This filter conversion and the two utils feels a bit tricky IMO.
Could this be upstream into the Vite createFilter
function so that it can be reused by other plugins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add a util function to Vite, we need to bump the required peer dep in this plugin (and the other plugins that wants to use that) which is a breaking change. I think if we do that we probably should add it to a separate package.
I'll consider if we can have @rolldown/pluginutils
(since I sent a PR to @rollup/pluginutils
that adds some utils functions and it's taking some time to be merged).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be added and then we could do import * as Vite from 'vite'
and check for the export name existence so that people using the latest version have the speedup (which is expecting for people running rolldown vite)
skipFastRefresh && | ||
isProduction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isProduction
implies skipFastRefresh
for now so we can skip the second check but it doesn't hurt so up to you
Description
Adds
filter
so that it makes these plugin performant when used in rolldown-vite.