Skip to content

Conversation

@benmccann
Copy link
Collaborator

@benmccann benmccann commented Feb 21, 2025

Description

As discussed on Discord, there may be some benefit to very selectively unbundling some of Vite's dependencies. The time to download Vite can actually be reduced by unbundling if the dependency is also used by the framework or tools being setup alongside vite as it means we only download the copy from npm rather than both the copy from npm and bundled copy.

tinyglobby is used by vitest, solidstart, astro, vitepress, nx, vike, nuxt, unimport (used by tanstack start), vite-plugin-checker, and vite-plugin-pwa. svelte doesn't use tinyglobby yet, but may soon and we do use both of its dependencies already. Other libraries adjacent to the ecosystem like eslint-import-resolver-typescript, tsup, and unocss use it as well.

@benmccann benmccann added the dependencies Pull requests that update a dependency file label Feb 21, 2025
@benmccann benmccann force-pushed the tinyglobby branch 2 times, most recently from 9c554c7 to 8bba980 Compare February 24, 2025 17:04
@sapphi-red
Copy link
Member

If we unbundle tinyglobby, I think we should unbundle picomatch as well. picomatch is a dependency of tinyglobby and Vite uses picomatch as well. If we only unbundle tinyglobby, we'll have picomatch both bundled and unbundled.

@benmccann
Copy link
Collaborator Author

Great catch! I've updated it to unbundle picomatch as well

@patak-dev patak-dev added this to the 6.3 milestone Mar 6, 2025
@sapphi-red sapphi-red changed the title chore: unbundle tinyglobby chore(deps): unbundle tinyglobby Mar 19, 2025
@sapphi-red sapphi-red merged commit a5ea6f0 into vitejs:main Mar 19, 2025
16 checks passed
@benmccann benmccann deleted the tinyglobby branch March 19, 2025 11:39
moonlitusun pushed a commit to moonlitusun/vite that referenced this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants