Skip to content

Commit 1e5c63c

Browse files
committed
chore: adjust build process
1 parent d4745fc commit 1e5c63c

3 files changed

Lines changed: 4 additions & 10 deletions

File tree

.vscode/dictionary.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ lockb
1919
mkcert
2020
openweb
2121
outdir
22+
outfile
2223
pausable
2324
pkgx
2425
Postcardware
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
1-
import path from 'node:path'
21
import { log } from '@stacksjs/logging'
32
import { $ } from 'bun'
43
import dts from 'bun-plugin-dts-auto'
54

65
log.info('Building...')
76

8-
$.cwd(path.resolve(import.meta.dir, '..'))
9-
await $`rm -rf ./dist`
10-
117
await Bun.build({
128
entrypoints: ['./src/index.ts', './bin/cli.ts'],
139
outdir: './dist',
1410
format: 'esm',
1511
target: 'bun',
1612
external: ['rollup', 'fsevents'],
17-
1813
plugins: [
19-
dts({
20-
cwd: path.resolve(import.meta.dir, '..'),
21-
}),
14+
dts(),
2215
],
2316
})
2417

2518
await $`cp ./dist/src/index.js ./dist/index.js`
2619
await $`rm -rf ./dist/src`
2720
await $`cp ./dist/bin/cli.js ./dist/cli.js`
2821
await $`rm -rf ./dist/bin`
29-
await $`cp ./bin/cli.d.ts ./dist/cli.d.ts` // while bun-plugin-dts-auto doesn't support bin files well
22+
await $`cp ./bin/cli.d.ts ./dist/cli.d.ts`
3023
await $`rm ./bin/cli.d.ts`
3124

3225
log.success('Built')

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
},
4343
"files": ["dist", "scripts", "src"],
4444
"scripts": {
45-
"build": "bun scripts/build.ts && bun run compile",
45+
"build": "bun build.ts",
4646
"compile": "bun build ./bin/cli.ts --compile --external rollup --minify --sourcemap --outfile dist/reverse-proxy",
4747
"postcompile": "bun ./scripts/post-compile.ts",
4848
"lint": "bunx biome check .",

0 commit comments

Comments
 (0)