-
-
Notifications
You must be signed in to change notification settings - Fork 507
Expand file tree
/
Copy pathbuild.ts
More file actions
31 lines (25 loc) · 675 Bytes
/
build.ts
File metadata and controls
31 lines (25 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { $ } from 'bun'
import { build } from 'tsup'
import { fixImportsPlugin } from 'esbuild-fix-imports-plugin'
import pack from './package.json'
if ('elysia' in pack.dependencies)
throw new Error("Error can't be a dependency of itself")
await $`rm -rf dist`
await build({
entry: ['src/**/*.ts'],
outDir: 'dist',
format: ['esm', 'cjs'],
target: 'node20',
minifySyntax: true,
minifyWhitespace: false,
minifyIdentifiers: false,
splitting: false,
sourcemap: false,
cjsInterop: false,
clean: true,
bundle: false,
external: ['@sinclair/typebox', 'file-type'],
esbuildPlugins: [fixImportsPlugin()]
})
await $`tsc --project tsconfig.dts.json`
process.exit()