-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbuild.mjs
More file actions
35 lines (31 loc) · 902 Bytes
/
build.mjs
File metadata and controls
35 lines (31 loc) · 902 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
34
35
import { build } from 'esbuild';
import { fileURLToPath } from 'url';
import { dirname, resolve } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
await build({
entryPoints: [resolve(__dirname, 'apps/cli/src/index.ts')],
bundle: true,
platform: 'node',
target: 'node20',
format: 'cjs',
outfile: resolve(__dirname, 'dist/index.cjs'),
external: [
'playwright', // Playwright has binaries, keep it external
],
banner: {
js: '#!/usr/bin/env node',
},
minify: false,
sourcemap: true,
});
await build({
entryPoints: [resolve(__dirname, 'packages/core/src/sub-agents/code-quality-subagent-worker.ts')],
bundle: true,
platform: 'node',
target: 'node20',
format: 'cjs',
outfile: resolve(__dirname, 'dist/code-quality-subagent-worker.cjs'),
sourcemap: true,
});
console.log('✅ CLI bundled successfully');