-
Notifications
You must be signed in to change notification settings - Fork 0
/
esbuild.js
42 lines (39 loc) · 907 Bytes
/
esbuild.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
40
41
42
const { build } = require('esbuild');
// Common configuration for all builds
const commonConfig = {
bundle: true,
platform: 'node',
format: 'cjs',
external: ['vscode'],
minify: true,
};
// Build targets
const buildTargets = [
{
entryPoints: ['./client/src/extension.ts'],
outfile: './out/client/src/extension.js',
},
{
entryPoints: ['./server/src/server.ts'],
outfile: './out/server/src/server.js',
},
{
entryPoints: ['./shared/types.ts'],
outfile: './out/shared/types.js',
},
{
entryPoints: ['./shared/ciaoParse.ts'],
outfile: './out/shared/ciaoParse.js',
},
];
(async () => {
try {
await Promise.all(
buildTargets.map((target) => build({ ...commonConfig, ...target }))
);
console.log('Bundling completed successfully!');
} catch (error) {
console.error('Error during bundling:', error);
process.exit(1);
}
})();