Incorrect default export in generated `.cjs` file when using `treeshake: true` · Issue #1319 · egoist/tsup · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The final distributable directory is dist, so we copy package.json there in pnpm build command. Then, with pnpm lint we call attw to check the package inside dist directory.
The text was updated successfully, but these errors were encountered:
Problem
When using
treeshake: true
option, the invalid default export is generated in.cjs
files, probably because of rollup usage. When building with rollup'streeshake
-@arethetypeswrong/cli
gives the following error (see https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseExportDefault.md for error explanation):However, if we set
treeshake: false
intsup.config.ts
and rebuild, the error is gone:To reproduce
git clone https://github.com/AlexShukel/tsup-cts-default-export
pnpm i
pnpm build
pnpm lint
The final distributable directory is
dist
, so we copypackage.json
there inpnpm build
command. Then, withpnpm lint
we callattw
to check the package insidedist
directory.The text was updated successfully, but these errors were encountered: