-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild-extension.mjs
More file actions
37 lines (30 loc) · 926 Bytes
/
build-extension.mjs
File metadata and controls
37 lines (30 loc) · 926 Bytes
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
import * as esbuild from 'esbuild'
import {copyToAppPlugin, copyManifestPlugin, commonConfig, bundleCssPlugin} from "./build.helpers.mjs"
import parseArgs from "minimist"
const outDir = `dist/database-explorer`
const appDir = "D:\\Workstation\\low-code\\mendix\\DatabaseExplorer-main"
const extensionDirectoryName = "extensions"
const entryPoints = [
{
in: 'src/main/index.ts',
out: 'main'
}
]
entryPoints.push({
in: 'src/ui/pane.tsx',
out: 'pane'
})
const args = parseArgs(process.argv.slice(2))
const buildContext = await esbuild.context({
...commonConfig,
outdir: outDir,
plugins: [bundleCssPlugin(outDir, "style.css", { inject: true }), copyManifestPlugin(outDir), copyToAppPlugin(appDir, outDir, extensionDirectoryName)],
entryPoints
})
if('watch' in args) {
await buildContext.watch();
}
else {
await buildContext.rebuild();
await buildContext.dispose();
}