forked from petrbroz/vscode-forge-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
esbuild.js
50 lines (46 loc) · 1.35 KB
/
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
43
44
45
46
47
48
49
50
const { build } = require('esbuild');
const baseConfig = {
bundle: true,
minify: process.env.NODE_ENV === 'production',
sourcemap: process.env.NODE_ENV !== 'production'
};
const extensionConfig = {
...baseConfig,
platform: 'node',
format: 'cjs',
entryPoints: ['./src/extension.ts'],
outfile: './out/extension.js',
external: ['vscode']
};
const webviewsConfig = {
...baseConfig,
target: 'es2020',
format: 'esm',
entryPoints: [
'./src/webviews/bucket-details.tsx',
'./src/webviews/object-details.tsx',
'./src/webviews/custom-translation.tsx',
'./src/webviews/thumbnails.tsx',
'./src/webviews/webhook-details.tsx',
'./src/webviews/create-webhook.tsx',
'./src/webviews/update-webhook.tsx',
'./src/webviews/derivative-preview.tsx',
'./src/webviews/appbundle-details.tsx',
'./src/webviews/alias-details.tsx',
'./src/webviews/activity-details.tsx',
'./src/webviews/create-activity.tsx',
'./src/webviews/update-activity.tsx',
'./src/webviews/create-workitem.tsx'
],
outdir: './out/webviews',
splitting: true
};
(async () => {
try {
await build(extensionConfig);
await build(webviewsConfig);
} catch (err) {
process.stderr.write(err.stderr);
process.exit(1);
}
})();