fix: add cjs format support

This commit is contained in:
ycjcl868 2024-12-31 16:19:20 +08:00
commit f27ec9db5d

23
tsup.config.ts Normal file
View file

@ -0,0 +1,23 @@
import { defineConfig, Options } from "tsup";
const commonConfig: Options = {
clean: true,
dts: true,
splitting: false,
tsconfig: "tsconfig.prod.json",
};
export default defineConfig([
{
...commonConfig,
entry: ["src/**/*"],
outDir: "dist/cjs",
format: ["cjs"],
},
{
...commonConfig,
entry: ["src/**/*"],
outDir: "dist/esm",
format: ["esm"],
},
]);