-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdev.ts
More file actions
33 lines (27 loc) · 718 Bytes
/
dev.ts
File metadata and controls
33 lines (27 loc) · 718 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
32
33
import { spawn } from 'bun'
const crosswindBin = '/Users/glennmichaeltorregosa/Documents/Projects/crosswind/packages/crosswind/bin/crosswind'
// Start crosswind watch
const crosswind = spawn([crosswindBin, 'watch', '--config', './crosswind.config.ts'], {
cwd: import.meta.dir,
stdout: 'inherit',
stderr: 'inherit',
})
// Start server
const server = spawn(['bun', 'serve.ts'], {
cwd: import.meta.dir,
stdout: 'inherit',
stderr: 'inherit',
})
// Handle cleanup
process.on('SIGINT', () => {
crosswind.kill()
server.kill()
process.exit(0)
})
process.on('SIGTERM', () => {
crosswind.kill()
server.kill()
process.exit(0)
})
// Wait for both
await Promise.all([crosswind.exited, server.exited])