-
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathdev.mjs
More file actions
29 lines (24 loc) · 571 Bytes
/
dev.mjs
File metadata and controls
29 lines (24 loc) · 571 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
import { spawn, execSync } from 'child_process';
import fkill from 'fkill';
execSync('pnpm -r exec --filter gqless -- tsc -m commonjs', {
stdio: 'inherit',
});
execSync('pnpm -r --filter test-utils build', {
stdio: 'inherit',
});
const processes = ['pnpm dev:start', 'pnpm dev:test'].map((script) => {
return spawn(script, {
detached: true,
shell: true,
}).pid;
});
process.on('SIGINT', () => {
fkill(processes, {
force: true,
}).catch(() => {});
});
process.on('exit', () => {
fkill(processes, {
force: true,
}).catch(() => {});
});