Created
March 1, 2025 12:04
-
-
Save youyoumu/c93d8242e8373a12d491b8cae1cb8bd2 to your computer and use it in GitHub Desktop.
tsup.config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { spawnSync } from "child_process"; | |
import { defineConfig } from "tsup"; | |
export default defineConfig((options) => ({ | |
entry: ["src/**/*.{ts,tsx}"], | |
format: "esm", | |
outDir: "dist", | |
splitting: false, | |
outExtension() { | |
return { | |
js: `.js`, | |
}; | |
}, | |
async onSuccess() { | |
spawnSync("tsc", ["--emitDeclarationOnly"]); | |
console.log("✅ declaration files generated"); | |
}, | |
...options, | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment