egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
8.48k stars 209 forks source link

fix: support swc target for mjs #1081

Closed haydnhkim closed 4 months ago

haydnhkim commented 5 months ago

If it is mjs, it is not included in the swcTarget even if I set it as an ES5 target. I think the reason for the exclusion of mjs is that if the browser supports import, it is guaranteed to run ES6 or later code. However, if you use a process like the one below, you'll run into problems.

In addition to this issue, I think it's also a problem that tsup's target is set to ES5 and it doesn't transpile as expected. So I've included MJS as well to solve this problem.

closes #1080

codesandbox[bot] commented 5 months ago

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

vercel[bot] commented 5 months ago

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 Feb 3, 2024 7:54am
haydnhkim commented 4 months ago

@sxzz Could you please review this PR?

haydnhkim commented 4 months ago

Thank you for your review!

github-actions[bot] commented 4 months ago

:tada: This PR is included in version 8.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: