egoist / tsup

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

fix: outExtension for generating dts files by rollup #1053

Open isuvorov opened 7 months ago

isuvorov commented 7 months ago

The problem:

Description: Rollup operates in a Node.js Worker threads and can only receive messages as plain objects (without functions). In tsup.config, outExtension is a function. Therefore if we send the config "as is", we encounter a DataCloneError.

Solution: Execute outExtension before sending message to rollup worker thread and send the array with outExtension results.

codesandbox[bot] commented 7 months ago

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tsup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 1, 2023 4:48pm
aryaemami59 commented 2 months ago

Is there anything we can do to help facilitate this change?

ndelangen commented 3 weeks ago

I tried upgrading storybook's monorepo to TSup 8 and it failed, and it's likely this would allow us to upgrade.