generated from stacksjs/ts-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ts
More file actions
26 lines (20 loc) · 530 Bytes
/
build.ts
File metadata and controls
26 lines (20 loc) · 530 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
import process from 'node:process'
import dts from './src'
// Do not use the plugin while building itself to avoid interfering with Bun's bundling
console.log('Building...')
const result = await Bun.build({
entrypoints: ['src/index.ts'],
outdir: 'dist',
target: 'bun',
external: ['@stacksjs/dtsx'],
plugins: [dts()],
// minify: true,
})
if (!result.success) {
console.error('Build failed')
for (const message of result.logs) {
console.error(message)
}
process.exit(1)
}
console.log('Build complete')