#TS to CommonJS?

1 messages · Page 1 of 1 (latest)

chrome osprey
#

Is there a way to build JS files so they are CommonJS syntax? bun build only outputs ESM. Ideally, I want bun build to use the options in tsconfig.json

spice cedar
quick sage
#

This is planned

next lake
#

May I ask the planned date of this?

quick sage
#

Not particularly soon

#

Most people who use Bun's bundler will also use the Bun runtime

#

And because Bun supports ESM there aren't many reasons to target CommonJS

next lake
#

I see. In my case I'm using bun to build and publish npm sdks with cjs+esm support for others to use. Currently I have to stick with esbuild because of this.

quick sage
#

yep we understand that

#

we'll be doing a lot of work on the bundler soon

bronze wren
#

Hi, has this changed and is this possible now?

#

I am trying to use the transpiler API but don't know how I can add support for cjs to it