Re:Finally, a guide for Node.js and TypeScript and ESM that ...
by herpdyderp on Tuesday November 21, 2023 @07:54AM
(#38363022)
Tsx is great but doesn’t work in all situations unfortunately. Some broken cases that I remember off the top of my head are Playwright and test coverage.
[ Parent
| on HN ]
Re:Finally, a guide for Node.js and TypeScript and ESM that ...
by privatenumber on Tuesday November 21, 2023 @08:49AM
(#38363543)
Maintainer of tsx here.
tsx should be able to handle Playwright as of v4+, and hopefully the test coverage you're referring to.
Before, it was compiling ESM syntax to CJS as an effort to ease the ecosystem's CJS -> ESM migration, and hiccuping whenever it encountered `eval()`. Now it includes smarter checks to determine if a file needs to be compiled at all and skips processing most dependencies.
Hope it works well for you!
Re:Finally, a guide for Node.js and TypeScript and ESM that ...
by herpdyderp on Tuesday November 21, 2023 @11:06AM
(#38365505)
I see v4 was published just 12 days ago. I'll have to give it another shot! Thanks!