POC: extension entry + esbuild bundle (Feature #2)
activate() registers showClineSdkInfo, which renders the SDK summary to a notification and output channel. esbuild bundles to CJS, keeping vscode and @cline/sdk external (the ESM SDK loads via runtime dynamic import). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
import { build, context } from "esbuild";
|
||||
|
||||
const watch = process.argv.includes("--watch");
|
||||
|
||||
/** @type {import('esbuild').BuildOptions} */
|
||||
const options = {
|
||||
entryPoints: ["src/extension.ts"],
|
||||
outfile: "out/extension.cjs",
|
||||
bundle: true,
|
||||
platform: "node",
|
||||
format: "cjs",
|
||||
target: "node20",
|
||||
sourcemap: true,
|
||||
// vscode is provided by the host; @cline/sdk is ESM-only and is loaded at
|
||||
// runtime via dynamic import() from node_modules, so keep both external.
|
||||
external: ["vscode", "@cline/sdk"],
|
||||
logLevel: "info",
|
||||
};
|
||||
|
||||
if (watch) {
|
||||
const ctx = await context(options);
|
||||
await ctx.watch();
|
||||
console.log("esbuild: watching…");
|
||||
} else {
|
||||
await build(options);
|
||||
console.log("esbuild: build complete → out/extension.cjs");
|
||||
}
|
||||
Reference in New Issue
Block a user