egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
8.49k stars 209 forks source link

tsup unnecessarily strips the `node:` prefix when building for cjs #1003

Open ericallam opened 9 months ago

ericallam commented 9 months ago

Calling require("node:path") was added in Node v14.18.0, but tsup adds the nodeProtocolPlugin to the list of esbuild plugins whenever building for cjs. I'd like to be able to build for cjs while targeting Node >= 14.18 and preserve the original node: require path. It also seems like this is unnecessary since esbuild handles this here:

https://github.com/evanw/esbuild/issues/1760

Upvote & Fund

Fund with Polar