-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
- Loading branch information
1 parent
b5122ab
commit 495c7f9
Showing
15 changed files
with
7,506 additions
and
9,327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import * as esbuild from "esbuild"; | ||
import copyStaticFiles from "esbuild-copy-static-files"; | ||
import process from "node:process"; | ||
import path from "node:path"; | ||
import { problemMatcher, removeStrict, nodeTpl } from "@hpcc-js/esbuild-plugins"; | ||
import tsconfigNode from "./tsconfig.json" with {"type": "json"}; | ||
import tsconfigBrowser from "./tsconfig.webview.json" with {"type": "json"}; | ||
|
||
const outputDirectory = "dist"; | ||
const watch = process.argv.includes("--watch"); | ||
const production = !watch && process.argv.includes("--production"); | ||
|
||
async function main(tsconfigRaw, entryPoint, platform, format, plugins = []) { | ||
const ctx = await esbuild.context({ | ||
tsconfigRaw, | ||
entryPoints: [entryPoint], | ||
outdir: outputDirectory, | ||
bundle: true, | ||
format, | ||
minify: production, | ||
sourcemap: !production ? "linked" : false, | ||
platform, | ||
target: platform === "node" ? "node20" : "es2022", | ||
external: ["vscode", "fs", "path", "os"], | ||
logLevel: production ? "silent" : "info", | ||
plugins: [ | ||
...plugins, | ||
problemMatcher(), | ||
] | ||
}); | ||
if (watch) { | ||
await ctx.watch(); | ||
} else { | ||
await ctx.rebuild(); | ||
await ctx.dispose(); | ||
} | ||
} | ||
|
||
Promise.all([ | ||
main(tsconfigNode, "./src/extension.ts", "node", "cjs"), | ||
main(tsconfigBrowser, "./src/notebook/renderers/ojsRenderer.ts", "browser", "esm"), | ||
main(tsconfigBrowser, "./src/webview.ts", "browser", "iife") | ||
]).catch((e) => { | ||
console.error(e); | ||
process.exit(1); | ||
}); |
Oops, something went wrong.