-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.js
37 lines (34 loc) · 793 Bytes
/
build.js
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
37
import { build } from 'esbuild';
import { readFileSync } from 'fs';
async function main() {
const pkg = JSON.parse(readFileSync('package.json', 'utf8'));
await build({
entryPoints: ['src/index.ts'],
bundle: true,
platform: 'node',
target: 'node18',
format: 'esm',
outfile: 'dist/index.js',
define: {
__VERSION__: JSON.stringify(pkg.version),
'process.env.NODE_ENV': JSON.stringify('production')
},
banner: {
js: `// Asana MCP Server v${pkg.version}\n`
},
external: [
// Node.js built-in modules that should not be bundled
'url',
'http',
'https',
'stream',
'zlib',
'util',
'events',
'buffer',
'querystring',
'asana'
]
});
}
main().catch(console.error);