Skip to content
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

Perf issue fix: avoid creating an inject plugin when there are no shims to inject #101

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jlas
Copy link

@jlas jlas commented Jul 27, 2024

I started using vite-plugin-node-polyfills on a fairly large vite project and it made vite build slower by 50-100%. It also caused increased memory usage (causing OOM errors).

I tracked down the source of the slowdown to the inject plugin. My config had globals.{Buffer, global, process} all set to false so the plugin was not necessary.

I reworked the logic to avoid passing in the inject plugin when there are no shims to inject.

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.

1 participant