-
-
Notifications
You must be signed in to change notification settings - Fork 664
Open
Labels
enhancementNew feature or requestNew feature or request
Description
This would solve...
Lines 62 to 63 in 74d505f
"main": "index.js", | |
"types": "index.d.ts", |
Bundlers are much better at tree-shaking ESM than they are at CJS.
The implementation should look like...
Line 65 in 74d505f
"build:node": "esbuild index-fetch.js --bundle --platform=node --outfile=undici-fetch.js --define:esbuildDetection=1 --keep-names && node scripts/strip-comments.js", |
Build with a transpiler like tsdown
instead of esbuild.
I have also considered...
Additional context
https://antfu.me/posts/move-on-to-esm-only
https://joyeecheung.github.io/blog/2024/03/18/require-esm-in-node-js/
Node.js v18 support was already dropped last year, so there's no compatibility benefit in (dual-)publishing CommonJS code at this point. #3880
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request