import { defineConfig, type UserConfig } from "tsdown"; const baseOptions: UserConfig = { clean: true, entry: ["src/**/*.ts"], dts: true, minify: false, skipNodeModulesBundle: true, sourcemap: true, target: "es2021", tsconfig: "tsconfig.json", keepNames: true, treeshake: true, }; export default [ defineConfig({ ...baseOptions, outDir: "dist/cjs", format: "cjs", outExtension: () => ({ js: ".cjs" }), }), defineConfig({ ...baseOptions, outDir: "dist/esm", format: "esm", }), ];