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:
Ben Stull
2026-06-09 23:55:39 -07:00
parent 33bff2b130
commit 80083c1230
2 changed files with 67 additions and 0 deletions
+27
View File
@@ -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");
}