-
Notifications
You must be signed in to change notification settings - Fork 0
/
serve.js
38 lines (34 loc) · 976 Bytes
/
serve.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
const fs = require("fs");
const rimraf = require("rimraf");
const esbuild = require("esbuild");
rimraf.sync("./dist/*");
const workerEntryPoints = [
'node_modules/monaco-editor/esm/vs/language/json/json.worker.js',
'node_modules/monaco-editor/esm/vs/language/css/css.worker.js',
'node_modules/monaco-editor/esm/vs/language/html/html.worker.js',
'node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js',
'node_modules/monaco-editor/esm/vs/editor/editor.worker.js'
];
require("esbuild").build({
logLevel: "info",
entryPoints: ["src/index.ts",
"src/ig-editor-lib/src/Exporter.ts",
...workerEntryPoints],
entryNames: "[name]",
bundle: true,
watch: true,
outdir: "dist",
loader: {
'.ttf': 'file',
'.ts': 'ts',
'.js': 'js'
}
}).then(() => {
require("./writeHtml");
esbuild.serve({
servedir: "./dist",
port: 8080,
},{}).then(() => {
require("./writeHtml");
});
});