80083c1230
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>
28 lines
742 B
JavaScript
28 lines
742 B
JavaScript
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");
|
|
}
|