这是indexloc提供的服务,不要输入任何密码
Skip to content

fix: estarget should omit es3 which is not supported with swc or esbuild #959

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

Closed
wants to merge 1 commit into from

Conversation

richerfu
Copy link

@richerfu richerfu commented Aug 2, 2023

Actally,the target is not supported with swc or esbuild. And if we set target with es3 will get some error.
So EsTarget should omit es3

@vercel
Copy link

vercel bot commented Aug 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tsup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 2, 2023 0:21am

Copy link
Collaborator

@sxzz sxzz left a comment

Choose a reason for hiding this comment

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

es3 is supported by SWC. https://swc.rs/playground
image

@richerfu
Copy link
Author

richerfu commented Aug 3, 2023

You are definitely right. Actally, tsup use esbuild to bundle files.

If target is es5,tsup add a plugin es5 https://github.com/egoist/tsup/blob/dev/src/plugins/es5.ts, and esbuild's target can be configured with es5. https://github.com/egoist/tsup/blob/dev/src/esbuild/index.ts#L172

es3 is not supported with esbuild, that will throw a error.

Error: Invalid target "es3" in "--target=es3"

There are two problems to resolve.

  1. add a es3 plugin that use swc to transform code
  2. if set es3, which value should be set for esbuild's target.

@richerfu
Copy link
Author

richerfu commented Aug 3, 2023

sxzz added a commit that referenced this pull request Aug 3, 2023
@sxzz sxzz mentioned this pull request Aug 3, 2023
@sxzz sxzz closed this in #965 Oct 16, 2023
Copy link
Contributor

🎉 This issue has been resolved in version 7.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants