jiti
jiti copied to clipboard
Try sucrase as babel alternative
- https://github.com/unjs/jiti/issues/26#issuecomment-803286043
- https://github.com/nuxt/vite/pull/201#issuecomment-918877146
https://github.com/alangpierce/sucrase
i think SWC would be a better choice because unlike sucrase it's extendable and part of the features already enabled in this project supported in SWC and not supported in sucrase (emitDecoratorMetadata f .ex)
And i don't belive that JS compiler might be faster than Rust's SWC or esbuild...
I guess with more babel deps and it's acceptable perf won't worth focusing on this.
I strongly agree with @thekip. The SWC community is rising fast, and I'm glad Rust-based stuff gets accepted quickly. SWC should be more comfortable to use.
I don't know but maybe the bundle size would decrease too. Sorry if I'm wrong. Because currently compiled dist/babel.js
is about to reach 2 MB. Tailwind started using Jiti recently, released an update, and its chart on bundlephobia jumped to the skies. When it doesn't really matter for tailwind, because it's being used in devDeps anyways, it matters tools that require Jiti for production (such as @lingui/macro)
I am open to experimenting! We could try an experimental build jiti/surcase
via optional surcase
peer dependency.
offtopic:
it matters tools that require Jiti for production (such as @lingui/macro)
I'm as an contributor of @lingui/macro
could say that it also doesn't matter, because macro executed in the compile time and jiti is not going to the bundle.