is-what
is-what copied to clipboard
Use `tsc`
This PR would...
- [x] Not solve the #37
- [x] Keep CJS and ESM builds
- [x] Remove rollup
- [x] Use tsc!
This is intended to be a non-breaking migration from rollup to tsc. Later #55 can be considered with the move to ESM-only
THIS DOES NOT SOLVE THE DUAL PACKAGE HAZARD ISSUE!
There's an open issue on typescript github to support changing file extensions at tsc buildtime. That hasn't been encouraged since it's mostly used to cause the not-so-great dual package hazard. Instead TS team seems to recommend that you just build an ESM or CJS and then wrap it in another .mjs or .cjs file as a facade for the other module system. https://github.com/microsoft/TypeScript/issues/49462
I used a tricksy hack to make the cjs folder treat .js as .cjs by putting a {"type":"commonjs"} package.json in there 😆
@mesqueeb This is the next PR that I think should be tackled 😊
closing in favour of https://github.com/mesqueeb/is-what/pull/87