I guess MicroBundle hasn't support TypeScript 4.x, because I got an error:
rpt2: config error TS5023: Unknown compiler option 'jsxFragmentFactory'.
Thanks will look into it 馃憤
Could you create a small comment on how to reproduce this? Or do you have a repo?
Just add an option "jsxFragmentFactory": "Fragment" in your tsconfig.json, and then run microbundle again, you'll see the error.
Here is the offical document: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#custom-jsx-factories
We should check TS version and use the appropriate config - it would be a shame to have Microbundle only work with TS 4.
Not only tsconfig.json options but also code syntax will have the same ts version problem.
In my case:
try {
something()
} catch (e: unknown) {
^ (rpt2 plugin) Error: semantic error TS1196: Catch clause variable cannot have a type annotation.
something()
}
Where here (e: unknown) is new syntax in TS 4.0, it's recommanded (safer) and checked by ESLint.
Maybe microbundle can try locally installed ts first before using rpt2's default one. Or at least some way to set the version manually.
Thanks for the idea and PR @whitetrefoil - good thinking.
Fixed in #738.
Most helpful comment
Not only tsconfig.json options but also code syntax will have the same ts version problem.
In my case:
Where here
(e: unknown)is new syntax in TS 4.0, it's recommanded (safer) and checked by ESLint.Maybe microbundle can try locally installed ts first before using rpt2's default one. Or at least some way to set the version manually.