tsup
uses sucrase
to transpile ESM to CJS when code splitting is enabled:
tsup/src/plugins/cjs-splitting.ts
Lines 21 to 31 in 83c7c7f
Unfortunately there is no way right now to specify the settings for sucrase
. In our case, we wanted to disable the optional chaining polyfill that sucrase
adds, since it's problematic for static analysis. The only way to do so seems to be by setting disableESTransforms: true
in the options. It would be great if tsup
had an option to set this.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too