Priority: HIGH
Problem
The extension currently ships raw TypeScript output instead of optimized bundles, which impacts:
- Activation time: All dependencies loaded unbundled at runtime
- Extension size: Currently 176KB but includes dependencies loaded separately
- Performance: Slower startup compared to bundled extensions
Solution
Implement esbuild bundling (modern, faster alternative to webpack).
Implementation Steps
- Install esbuild:
npm install --save-dev esbuild
- Create
esbuild.js:
const esbuild = require('esbuild');
const production = process.argv.includes('--production');
const watch = process.argv.includes('--watch');
async function main() {
const ctx = await esbuild.context({
entryPoints: ['src/extension.ts'],
bundle: true,
format: 'cjs',
minify: production,
sourcemap: !production,
sourcesContent: false,
platform: 'node',
outfile: 'dist/extension.js',
external: ['vscode'],
logLevel: 'info',
});
if (watch) {
await ctx.watch();
} else {
await ctx.rebuild();
await ctx.dispose();
}
}
main().catch((e) => {
console.error(e);
process.exit(1);
});
- Update
package.json:
{
"main": "./dist/extension.js",
"scripts": {
"vscode:prepublish": "npm run package",
"compile": "tsc -p tsconfig.json",
"package": "node esbuild.js --production",
"watch": "node esbuild.js --watch"
}
}
- Update
.vscodeignore:
src/**
tsconfig.json
out/**
Reference
VSCode Extension Bundling Guide
Expected Impact
- Faster activation time
- Smaller extension package size (~50KB bundled vs 176KB+ unbundled)
- Better user experience
Priority
HIGH - Should be implemented before next release
Priority: HIGH
Problem
The extension currently ships raw TypeScript output instead of optimized bundles, which impacts:
Solution
Implement esbuild bundling (modern, faster alternative to webpack).
Implementation Steps
esbuild.js:package.json:{ "main": "./dist/extension.js", "scripts": { "vscode:prepublish": "npm run package", "compile": "tsc -p tsconfig.json", "package": "node esbuild.js --production", "watch": "node esbuild.js --watch" } }.vscodeignore:Reference
VSCode Extension Bundling Guide
Expected Impact
Priority
HIGH - Should be implemented before next release