feat: drop node < 18, es module, update testing to use vitest
BREAKING CHANGE: drop node < 18, es modules and cjs
Not that big of a change, mostly lockfile bloating the numbers
@SBoudrias I was wondering on the dual version and if it was needed, this answers my question. Any suggestions on how to do the dual variant?
I found it not too complicated to put together with Typescript (if you don't mind using it for cli-width.) Not sure how I'd approach it just with raw JS.
But you can see I generate 2 tsconfig (tsconfig.json/tsconfig.cjs.json.) And then I compile both output at build time. And lastly, there's a "bug" in TS where the output isn't clear... So last step is run a little script to fix the files imports.
The extension issue maybe could be fixed if I didn't use .mts, but that caused some other issues. So that ended up being easier for me (without having to rely on another build-tool middle layer I need to learn, configure and maintain.)
Hope this help - esm/cjs is far from easy today unfortunately 😞