import { rmdirSync, existsSync } from 'node:fs'; if (await existsSync('./dist')) { await rmdirSync('./dist'); } await Bun.build({ entrypoints: ['src/index.ts'], outdir: './dist', naming: '[dir]/[name].[ext]', sourcemap: true, format: 'esm', }); await Bun.build({ entrypoints: ['src/index.ts'], outdir: './dist', naming: '[dir]/[name].cjs.[ext]', sourcemap: true, format: 'cjs', });