-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
feat: expose createFilter util #8562
Conversation
@@ -44,7 +44,6 @@ | |||
"@babel/plugin-transform-react-jsx-development": "^7.16.7", | |||
"@babel/plugin-transform-react-jsx-self": "^7.17.12", | |||
"@babel/plugin-transform-react-jsx-source": "^7.16.7", | |||
"@rollup/pluginutils": "^4.2.1", | |||
"react-refresh": "^0.13.0" | |||
}, | |||
"peerDependencies": { |
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.
In case, Every plugin using needs to bump peerDeps after Vite's release.
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 are already requiring this for all internal plugins for v3, no? If not, yes, we should.
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 are requiring ^3.0.0-alpha
which means 3.0.0-alpha.1
can be used.
But now we need to require ^3.0.0-alpha.11
(next version). (since createFilter
is not exported in Vite 3.0.0-alpha.10, current version)
The CJS build size is bigger mainly because of dist size (picomatch not externalized): 3.21MB |
Given that we only have 4 deps externalized right now, I would prefer to avoid externalizing |
IMO it is possible to have an extra 50kB for this. 👍 |
Giving a +1 as it'd help remove the |
because `createFilter` util is exposed from Vite v3. vitejs/vite#8562
because `createFilter` util is exposed from Vite v3. vitejs/vite#8562
because `createFilter` util is exposed from Vite v3. vitejs/vite#8562
@@ -208,7 +208,7 @@ function createCjsConfig(isProduction: boolean) { | |||
...Object.keys(pkg.dependencies), | |||
...(isProduction ? [] : Object.keys(pkg.devDependencies)) | |||
], | |||
plugins: [...createNodePlugins(false, false, false), bundleSizeLimit(55)] | |||
plugins: [...createNodePlugins(false, false, false), bundleSizeLimit(120)] |
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.
Quick question: How much leeway do you give the bundle size limit?
Description
We are already exposing
normalizePath
, another@rollup/pluginutils
function.createFilter
is used internally and in the plugins in the monorepo. Exposing it in Vite may encourage more people to follow the recommended include/exclude pattern.Reference discussion with @sheremet-va for Vitest: vitest-dev/vitest#1467 (comment)
@antfu I needed to bump the size limit of the CJS build. I tried to avoid exposing
createFilter
in publicUtils but we are ourselves using the CJS build for plugins internally. Do you think the extra 50kb is an issue here? The other option is to avoid its use in our plugins for the moment.What is the purpose of this pull request?