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

Bun.plugin should return BunPlugin #16373

Open
huseeiin opened this issue Jan 13, 2025 · 0 comments
Open

Bun.plugin should return BunPlugin #16373

huseeiin opened this issue Jan 13, 2025 · 0 comments
Labels
bun.js Something to do with a Bun-specific API enhancement New feature or request

Comments

@huseeiin
Copy link
Contributor

huseeiin commented Jan 13, 2025

What is the problem this feature would solve?

when registering a runtime a plugin like this Bun.plugin(), sometimes i wanna also use that plugin in Bun.build but Bun.plugin doesn't return it so i have to work around that like this:

// export for Bun.build
export const plugin: BunPlugin = {}

// register for runtime
Bun.plugin(plugin)

the more optimal way this can be done is:

export const plugin: BunPlugin /* it's currently void */ = Bun.plugin({})

What is the feature you are proposing to solve the problem?

make Bun.plugin return itself, BunPlugin!

What alternatives have you considered?

No response

@huseeiin huseeiin added the enhancement New feature or request label Jan 13, 2025
@RiskyMH RiskyMH added the bun.js Something to do with a Bun-specific API label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bun.js Something to do with a Bun-specific API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants