-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
esbuild.js
73 lines (68 loc) · 1.28 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const { build } = require('esbuild');
const [, , arg] = process.argv;
const logger = console;
const isWatchMode = arg === '--watch';
build({
entryPoints: ['src/extension.ts', 'src/server/index.ts'],
bundle: true,
minify: arg === '--minify',
platform: 'node',
outdir: 'out/',
format: 'cjs',
sourcemap: true,
external: [
// Avoid bundling @vue/compiler-sfc's dynamic dependencies
'squirrelly',
'teacup',
'coffee-script',
'marko',
'slm',
'vash',
'plates',
'babel-core',
'htmling',
'ractive',
'mote',
'eco',
'jqtpl',
'hamljs',
'jazz',
'hamlet',
'whiskers',
'haml-coffee',
'hogan.js',
'templayed',
'walrus',
'mustache',
'just',
'ect',
'toffee',
'twing',
'dot',
'bracket-template',
'vscode',
'velocityjs',
'dustjs-linkedin',
'atpl',
'liquor',
'twig',
],
})
.then(({ errors, warnings }) => {
if (warnings.length) {
logger.warn(...warnings);
}
if (errors.length) {
logger.error(...errors);
}
logger.log('successfully bundled vscode-graphql 🚀');
if (isWatchMode) {
logger.log('watching... 🕰');
} else {
process.exit();
}
})
.catch(err => {
logger.error(err);
process.exit(1);
});