-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.cjs
45 lines (41 loc) · 968 Bytes
/
build.cjs
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
const esbuild = require('esbuild');
const path = require('path');
const workerEntryPoints = [
'vs/language/json/json.worker.js',
'vs/language/css/css.worker.js',
'vs/language/html/html.worker.js',
'vs/editor/editor.worker.js'
];
build({
entryPoints: workerEntryPoints.map((entry) => `node_modules/monaco-editor/esm/${entry}`),
bundle: true,
format: 'esm',
minify: true,
outbase: 'node_modules/monaco-editor/esm/',
outdir: path.join(__dirname, 'resources/scripts/dist')
});
build({
entryPoints: [
'resources/scripts/jinn-monaco.js'
],
bundle: true,
format: 'esm',
minify: true,
outdir: path.join(__dirname, 'resources/scripts/dist'),
loader: {
'.ttf': 'binary'
}
});
/**
* @param {import ('esbuild').BuildOptions} opts
*/
function build(opts) {
esbuild.build(opts).then((result) => {
if (result.errors.length > 0) {
console.error(result.errors);
}
if (result.warnings.length > 0) {
console.error(result.warnings);
}
});
}