-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathesbuild.js
46 lines (43 loc) · 1.24 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
const { build } = require("esbuild");
const { copy } = require("esbuild-plugin-copy");
const production = process.argv.includes("--production");
async function main() {
const files = {
"images/**": "./images",
"snippets/**": "./snippets",
"syntaxes/**": "./syntaxes",
"CHANGELOG.md": "./CHANGELOG.md",
"LICENSE.md": "./LICENSE.md",
"README.md": "./README.md",
"src/welcomePage/welcome-vscode.md": "./welcome-vscode.md",
"src/welcomePage/welcome-cursor.md": "./welcome-cursor.md",
"language-configuration.json": "./language-configuration.json",
"package.json": "./package.json",
"node_modules/mermaid/dist/mermaid.min.js": "media"
};
if (!production)
files["language-server/build/libs/language-server-all.jar"] = "bin";
await build({
entryPoints: ["src/extension.ts"],
bundle: true,
format: "cjs",
minify: production,
sourcemap: !production,
sourcesContent: false,
platform: "node",
outfile: "build/extension.js",
external: ["vscode"],
logLevel: "silent",
plugins: [
copy({
assets: Object.entries(files).map(([from, to]) => {
return { from, to };
})
})
]
});
}
main().catch((e) => {
console.error(e);
process.exit(1);
});