Hacker News new | ask | show | jobs
by moron4hire 997 days ago
You don't necessarily need a bundler. You could use index.ts files to re-export all the exports of your source files.
1 comments

I don't see how that changes the problem that OP describes.

TS module resolution looks almost like ESM, but neither the syntax nor the semantics are the same.

And or course you need a compiler to transpile TS, even if you wish to ignore the typings (often wrapped in a bundler like Vite which in turn wraps swc or ESBuild... because tsc is not as practical for large projects)

Really, having dealt with this kind of problem on Friday, it can make you go crazy.

E.g. having to deal with CJS-specific settings for some tool in a project using TS and exporting to ESM JS...