Files
netris-nestri/packages/auth/script/build.ts
2026-08-06 22:13:51 +03:00

24 lines
580 B
TypeScript

import { Glob, $ } from 'bun';
import pkg from '../package.json';
await $`rm -rf dist`;
const files = new Glob('./src/**/*.{ts,tsx}').scan();
for await (const file of files) {
await Bun.build({
format: 'esm',
outdir: 'dist/esm',
external: ['*'],
root: 'src',
entrypoints: [file]
});
}
await Bun.build({
format: 'esm',
outdir: 'dist/esm',
external: [...Object.keys(pkg.dependencies), ...Object.keys(pkg.peerDependencies)],
root: 'src',
entrypoints: ['./src/ui/base.tsx']
});
await $`tsc --outDir dist/types --declaration --emitDeclarationOnly --declarationMap`;