refactor: make dist/ ESM - #250
Conversation
| "module": "nodenext", | ||
| "moduleResolution": "nodenext", | ||
| "rewriteRelativeImportExtensions": true, | ||
| "erasableSyntaxOnly": true, |
There was a problem hiding this comment.
This isn't strictly necessary and can be removed. However, my experience shows that it's beneficial to use it unless enums are required. It ensures that the emitted code stays as close as possible to the source.
It also makes it extremely easy to enable node's type stripping. Since this project's development is mostly running tests and vitest has no issues running TS anyway, it's not a direct benefit. Should you want to drop vitest, however, it's way easier then 😉
|
Thanks! I have to admit that I'm one of those people with an irrational hatred of file extensions in imports 😂 so while this is a nice modernization, I'll need to think about it and get over it before merging |
|
I finally convinced myself :) Bumped the min version of node to 22 (since 20 and below are EOL). Thanks for taking the lead on this! |
Hey, I saw you're modernising the setup and that there's likely another major coming up.
If this interests you, the following changes make the output
dist/ESM. For node.js users, it will require 20.19+ (package.jsoncurrently specifies engine >= 18).