Currently, in order to enable externalHelpers for legacy decorators in SWC, users need to manually patch swc.transformFile. It would be helpful if tsup provided a way to specify this option without requiring modifications to SWC itself.
Example workaround:
const transformFile = swc.transformFile;
swc.transformFile = (filePath, options) => {
if (options?.jsc?.transform?.legacyDecorator) options.jsc.externalHelpers = true;
return transformFile.call(this, filePath, options);
};
Proposed solution:
Introduce an option in tsup to allow enabling externalHelpers when using decorators, eliminating the need for manual patches.
Currently, in order to enable externalHelpers for legacy decorators in SWC, users need to manually patch swc.transformFile. It would be helpful if tsup provided a way to specify this option without requiring modifications to SWC itself.
Example workaround:
Proposed solution:
Introduce an option in tsup to allow enabling externalHelpers when using decorators, eliminating the need for manual patches.