-
Notifications
You must be signed in to change notification settings - Fork 3
/
esbuild.config.js
39 lines (36 loc) · 947 Bytes
/
esbuild.config.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
38
39
const esbuild = require('esbuild');
const fs = require('fs');
// Build client
esbuild.build({
entryPoints: [
'./client/src/extension.ts'
],
bundle: true,
outfile: './out/client.js',
platform: 'node',
external: [
'vscode'
],
format: 'cjs',
tsconfig: './client/tsconfig.json',
}).catch(() => process.exit(1));
// Build server
esbuild.build({
entryPoints: [
'./server/src/server.ts'
],
bundle: true,
outfile: './out/server.js',
platform: 'node',
external: [
'vscode',
],
format: 'cjs',
tsconfig: './server/tsconfig.json',
}).catch(() => process.exit(1));
// Copy tree-sitter.wasm and tree-sitter-metamodelica.wasm to the output directory
if (!fs.existsSync('out')) {
fs.mkdirSync('out');
}
fs.copyFileSync('./server/src/tree-sitter-metamodelica.wasm', './out/tree-sitter-metamodelica.wasm');
fs.copyFileSync('./server/node_modules/web-tree-sitter/tree-sitter.wasm', './out/tree-sitter.wasm');