forked from colbymchenry/codegraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbundle.mjs
More file actions
36 lines (33 loc) · 992 Bytes
/
bundle.mjs
File metadata and controls
36 lines (33 loc) · 992 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
36
import { build } from 'esbuild';
const external = ['better-sqlite3', 'web-tree-sitter', 'node-sqlite3-wasm', 'tree-sitter-wasms'];
const common = {
bundle: true,
platform: 'node',
target: 'node20',
format: 'cjs',
external,
};
await Promise.all([
build({
...common,
entryPoints: [
{ in: 'src/bin/codegraph.ts', out: 'codegraph' },
{ in: 'src/bin/node-version-check.ts', out: 'node-version-check' },
{ in: 'src/bin/uninstall.ts', out: 'uninstall' },
{ in: 'src/ui/shimmer-worker.ts', out: 'shimmer-worker' },
{ in: 'src/extraction/parse-worker.ts', out: 'parse-worker' },
],
outdir: 'dist/bin',
}),
build({
...common,
entryPoints: ['src/index.ts'],
outfile: 'dist/index.js',
}),
// parse-worker must also live alongside dist/index.js for library consumers
build({
...common,
entryPoints: ['src/extraction/parse-worker.ts'],
outfile: 'dist/parse-worker.js',
}),
]);