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

Ability to override build target #45

Closed
shuding opened this issue Jun 30, 2021 · 7 comments · Fixed by #108
Closed

Ability to override build target #45

shuding opened this issue Jun 30, 2021 · 7 comments · Fixed by #108

Comments

@shuding
Copy link

shuding commented Jun 30, 2021

It seems that ES5 is always the build output target, and will override the project tsconfig value:

target: "ES5",

@huozhi
Copy link
Owner

huozhi commented Jul 1, 2021

@shuding This was intended to make sure all the output are compatible with es5, mostly for browser compatibility. Override it inside the bundler to let user configure less.
Very good callout, I was also wondering should we use mordern syntaxes for node.js project. What's your case here that you'd like to use other target besides ES5?

@shuding
Copy link
Author

shuding commented Jul 1, 2021

I think ES5 can be a good default, but shouldn't override user's intention in tsconfig. For example I want to try ESNext to drop IE support.

@huozhi
Copy link
Owner

huozhi commented Jul 7, 2021

TIL from styfle that we can use node version to specific ecmascript version with babel

node10 => es2018
node12 => es2019
node14 => es2020

I'll think of that later, maybe to provide a CLI option instead consuming from tsconfig to make the behavior consistent between js and ts inputs

@shuding
Copy link
Author

shuding commented Jul 9, 2021

Wow that’s interesting… but eventually I believe Bunchee needs its own config file. 😄

@huozhi
Copy link
Owner

huozhi commented Jul 11, 2021

Short term, consider esbuild as an alternative for testing?

Since IE is deprecated in 2022 soon, we might want to support es6 output

@koba04
Copy link

koba04 commented Jul 31, 2022

IE is now officially out of support, so it's time to change the target version.
vercel/swr#2095

@huozhi
Copy link
Owner

huozhi commented Jul 31, 2022

I'm waiting for a change on swc side so that I could adopt swc, then the target will easier to control

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

Successfully merging a pull request may close this issue.

3 participants