-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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: default build.minify to esbuild #5041
Conversation
to avoid alter behavior when using terser
+1 to switching to |
Unfortunately our current test setup relies quite heavily on Yarn's node_modules layout. I tried to move to pnpm but many of the tests are breaking due to not being able to resolve correctly when copied to a different temp directory. |
Another trouble with pnpm right now is that there's no differentiation between |
I managed to get a decent amount of tests passing under pnpm in a WIP branch: https://github.com/vitejs/vite/tree/pnpm There are a few tests still failing but I think eventually we should be able to move over. |
Ran into this aswell when i converted vite-plugin-svelte to pnpm. I resorted to symlinking packages/playground/xxx/node_modules to /temp/serve/xxx/node_modules iirc vite doesn't use /temp/serve and /temp/build for separate test dirs, but the pattern could still apply edit: I'm pretty stoked about the pnpm move too. Tops my list of great news for vite this week. ❤️ |
Another one for pnpm.. You can use |
* feat: default build.minify to esbuild * refactor: only enable extra options if minify is true to avoid alter behavior when using terser * wip: fix default option check
build.minify
to esbuild, which is 20 ~ 40x faster than terser and only 1 ~ 2% worse compression. BenchmarksterserOptions
was previously specifiedCaveats
optionalDependencies
(details in its changelog). The only downside is that all versions of Yarn will download binaries for all platforms (and eventually only install one), so installing with Yarn will become significantly slower. Not sure if there is a way around this - maybe we should encourage users to use npm/pnpm and avoid Yarn. (And we should probably switch to pnpm in the vite repo itself)