mirror of
https://github.com/zoriya/elysia-swagger.git
synced 2025-12-06 00:36:10 +00:00
38 lines
695 B
TypeScript
38 lines
695 B
TypeScript
import { $ } from 'bun'
|
|
import { build, type Options } from 'tsup'
|
|
|
|
await $`rm -rf dist`
|
|
|
|
const tsupConfig: Options = {
|
|
entry: ['src/**/*.ts'],
|
|
splitting: false,
|
|
sourcemap: false,
|
|
clean: true,
|
|
bundle: true
|
|
} satisfies Options
|
|
|
|
await Promise.all([
|
|
// ? tsup esm
|
|
build({
|
|
outDir: 'dist',
|
|
format: 'esm',
|
|
target: 'node20',
|
|
cjsInterop: false,
|
|
...tsupConfig
|
|
}),
|
|
// ? tsup cjs
|
|
build({
|
|
outDir: 'dist/cjs',
|
|
format: 'cjs',
|
|
target: 'node20',
|
|
// dts: true,
|
|
...tsupConfig
|
|
})
|
|
])
|
|
|
|
await $`tsc --project tsconfig.dts.json`
|
|
|
|
await Promise.all([$`cp dist/*.d.ts dist/cjs`])
|
|
|
|
process.exit()
|