Plans for dual build CJS, ESM
Hi,
Is there a plan to support both CJS and ESM?
Having both, CJS and ESM, would be great when one project wants to switch to pure ESM without looking for an alternative like p-limit.
I don't mind sending the PR for this.
@woss Hey Daniel, yes: supporting CJS and ESM is planned. I would appreciate your pull request to support this š thank you!
Perfect, hopefully soon i'll send the PR :) it's December after all, time for mulled wine and sauerkraut :)
@woss Thank you!
We have a need for pure ESM, @woss I can take this on if you haven't started.
@marcuspoehls any opinions on tooling, tsup, tsdown, etc?
Hey @jimmy-guzman, feel free to start implementing this. I can help if you need me.
I learned a few things in the last few months while doing the same for packages in one complex system, which might be helpful.
If we do not decide to release this as a new major version, then we should keep TSC as the CJS compiler, for example, swc compiles it differently than TSC, and that will break for most people. If we decide to rework and release a new major version we can do anything we want.
I'd say candidates are https://swc.rs/ and https://rolldown.rs/
@jimmy-guzman Hey Jimmy, I prefer staying with tsc. We may also check out the tsgo preview, Iām fine using tsgo to create the bundle if that works nicely (creating correct output/types/declaration files (if needed)).
Thank you for your help here š Iām highly appreciating it!