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

feat: support bun plugin #333

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

feat: support bun plugin #333

wants to merge 4 commits into from

Conversation

Dunqing
Copy link
Contributor

@Dunqing Dunqing commented Sep 2, 2023

πŸ”— Linked issue

close: #329

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@sxzz sxzz mentioned this pull request Sep 15, 2023
8 tasks
@antfu
Copy link
Member

antfu commented Sep 17, 2023

@sxzz would you like to work together on this?

@Dunqing what blockers do you see missing from having this PR ready? If there is limitations on bun, I think we may stated them in the README and get the basic feature shipped first.

@Dunqing
Copy link
Contributor Author

Dunqing commented Sep 18, 2023

@sxzz would you like to work together on this?

@Dunqing what blockers do you see missing from having this PR ready? If there is limitations on bun, I think we may stated them in the README and get the basic feature shipped first.

Currently, we can't run tests using the bunx --bun vitest because vitest doesn't support bun yet. We may need to wait until vitest supports bun

Alternatively, we can put the bun test cases in a separate directory rewrite the bun-related test cases with bun:test and run the tests with bun

meta.build = build
const { onResolve, onLoad, config: initialOptions } = build

const onResolveFilter = plugin.esbuild?.onResolveFilter ?? /.*/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const onResolveFilter = plugin.esbuild?.onResolveFilter ?? /.*/
const onResolveFilter = plugin.bun?.onResolveFilter ?? /.*/

const { onResolve, onLoad, config: initialOptions } = build

const onResolveFilter = plugin.esbuild?.onResolveFilter ?? /.*/
const onLoadFilter = plugin.esbuild?.onLoadFilter ?? /.*/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const onLoadFilter = plugin.esbuild?.onLoadFilter ?? /.*/
const onLoadFilter = plugin.bun?.onLoadFilter ?? /.*/

}

// `load` and `transform` may return a sourcemap without toString and toUrl,
// but esbuild needs them, we fix the two methods
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// but esbuild needs them, we fix the two methods
// but bun needs them, we fix the two methods

@sxzz sxzz force-pushed the main branch 4 times, most recently from e01729c to af3b0ec Compare March 6, 2024 11:09
@sxzz sxzz force-pushed the main branch 2 times, most recently from 8ba3416 to 6fb5709 Compare March 12, 2024 08:06
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.

[feature request] bun plugin support
3 participants