要创建捆绑包,我在 CLI 中运行以下命令:
bun build ./index.ts --outdir ./build
tsconfig.json
{ "compilerOptions": { "declaration": true, }, }
将创建单个捆绑文件
.build/index.js
此外,我希望将所有使用的类型定义捆绑在一个 .d.ts 文件中。
如何获取此文件?
Bun 无法构建类型定义。
因此,唯一的选择是运行
tsc --emitDeclarationOnly