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

Migrate to use Bun.js instead of Vite #1429

Closed
harmonyharmo opened this issue Feb 13, 2025 · 4 comments
Closed

Migrate to use Bun.js instead of Vite #1429

harmonyharmo opened this issue Feb 13, 2025 · 4 comments
Labels

Comments

@harmonyharmo
Copy link

harmonyharmo commented Feb 13, 2025

Feature Request

It's much faster to use Bun.js instead of Vite during a test I run. Vite takes about 10-15s to generate the content scripts while Bun is <1s!! Note this happens for any change I make so the developer experience is far better.

Is your feature request related to a bug?

"N/A"

What are the alternatives?

Current solution: Vite

Additional context

Seems not too difficult. Super easy to set up the watch following WXT convension. Using the injectUI code from WXT is a bit tricky.

@aklinker1
Copy link
Collaborator

In the long term, this could be a good idea. Currently though, bun doesn't have an in-depth plugin system that support things like Vue. But Bun just uses esbuild behind the scenes, which Vite also uses. Plus, soon, Vite's going to use rolldown, and there will be speed improvements using native code.

I have tried to keep Vite inside its own abstraction so we could hot swap it or provide alternative build solutions. But right now, I'm going to say no to this.

@aklinker1 aklinker1 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2025
@harmonyharmo
Copy link
Author

OK. I wonder what's the best way to import the injectUIToPage directly instead of relying on unimport. That's the only thing preventing me from hotswapping now.

One caveat is Bun uses its own stuff instead of esbuild I think https://bun.sh/docs/bundler/vs-esbuild

@harmonyharmo
Copy link
Author

scripts not having its UI can hotswap without problem already

@aklinker1
Copy link
Collaborator

One caveat is Bun uses its own stuff instead of esbuild I think https://bun.sh/docs/bundler/vs-esbuild

Huh, you're right, I thought it just used esbuilt under the hood, but I guess I was wrong!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants