-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathesbuild.config.js
More file actions
32 lines (31 loc) · 810 Bytes
/
Copy pathesbuild.config.js
File metadata and controls
32 lines (31 loc) · 810 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
import esbuild from 'esbuild';
import { chmodSync } from 'fs';
esbuild
.build({
entryPoints: ['./src/cli.ts'],
bundle: true,
platform: 'node',
target: 'node18',
outfile: './out/cli.cjs',
format: 'cjs',
external: [
// External dependencies that should not be bundled
'tiktoken',
'@dqbd/tiktoken'
],
minify: true,
sourcemap: false,
banner: {
js: '#!/usr/bin/env node'
}
})
.then(() => {
// Make it executable on Unix systems
try {
chmodSync('./out/cli.cjs', '755');
} catch (e) {
// Ignore on Windows
}
console.log('Build completed successfully!');
})
.catch(() => process.exit(1));