ci: bundle VS Code extension with esbuild - #123
Conversation
Bundles the extension into a single out/extension.js at publish time so the VSIX ships only the files needed at runtime. Previously the packaged extension included node_modules and every compiled TypeScript file — 390 files, 255 of which were JS — which vsce warned about for performance. After bundling the VSIX now contains 8 files: the bundled extension.js, the Go language server binary, and the static assets (package.json, grammar, icon, etc.). - Add esbuild as a devDependency and an esbuild.js build script - Add bundle and bundle:watch npm scripts; vscode:prepublish now runs bundle instead of tsc so the published artifact is the bundled file - Tighten .vscodeignore to exclude node_modules, src, scripts, docs, testFixture, build artifacts, and editor/local config that leaked into the VSIX The tsc-based compile and watch scripts are kept as-is for local F5 debugging (launch.json still invokes the watch task).
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 50 minutes and 18 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Explain how vsce's vscode:prepublish hook chains into esbuild bundling and the Go binary build, what ends up in the VSIX, and how to produce one locally.
Summary
out/extension.jsinstead of the entirenode_modulestreevscebundling warning surfaced in run #24476768226Changes
esbuildas a devDependency and a smallesbuild.jsbuild scriptbundle/bundle:watchnpm scripts;vscode:prepublishnow runsbundle(esbuild) instead ofcompile(tsc) so the published artifact is the bundled file.vscodeignoreto excludenode_modules,src,scripts,docs,testFixture, build artifacts, and editor/local config that previously leaked into the VSIXThe tsc-based
compile/watchscripts are kept as-is for local F5 debugging —launch.jsonstill invokes thewatchtask, so the dev loop is unchanged.Test plan
npm run bundleproducesout/extension.js(~347 KB, minified,vscodemarked external)tsc -bstill type-checks cleanvsce lsreports 8 files packaged (down from 390)