Switch to esbuild's native watcher for building extensions#312283
Merged
mjbvz merged 4 commits intomicrosoft:mainfrom Apr 24, 2026
Merged
Switch to esbuild's native watcher for building extensions#312283mjbvz merged 4 commits intomicrosoft:mainfrom
mjbvz merged 4 commits intomicrosoft:mainfrom
Conversation
This should be good to use now and also lets use benefit from incremental builds Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Switches the extension/webview esbuild build scripts from @parcel/watcher-driven rebuilds to esbuild’s native context(...).watch() to enable incremental builds and simplify watch mode.
Changes:
- Move default webview esbuild options into
run()and makebuild()directly callesbuild.build(options). - Replace
@parcel/watcher-based--watchimplementation withesbuild.context(...).watch()in both common scripts. - Replace
tryBuilderror-swallowing flow with an esbuild plugin that invokesdidBuildon build end.
Show a summary per file
| File | Description |
|---|---|
| extensions/esbuild-webview-common.mts | Uses esbuild’s native watch mode for webview builds and wires didBuild via an onEnd plugin. |
| extensions/esbuild-extension-common.mts | Uses esbuild’s native watch mode for extension builds and wires didBuild via an onEnd plugin. |
Copilot's findings
Comments suppressed due to low confidence (2)
extensions/esbuild-webview-common.mts:67
- Switching to
ctx.watch()means rebuilds (and thereforedidBuild) will only run when esbuild detects an input/dependency change. If callers usedidBuildto copy non-imported assets fromconfig.srcDir(e.g. shell scripts, JSON, etc.), edits to those files will no longer trigger the post-build step. Consider adding a lightweight directory watcher forconfig.srcDir(or documenting the limitation) so non-bundled files still get picked up during--watch.
const ctx = await esbuild.context(resolvedOptions);
await ctx.watch();
extensions/esbuild-extension-common.mts:87
- Switching to
ctx.watch()means rebuilds (and thereforedidBuild) will only run when esbuild detects an input/dependency change. Some callers usedidBuildto copy non-imported assets fromconfig.srcDir(e.g.extensions/gitcopies*.shfiles); edits to those files will no longer trigger during--watch. Consider adding a directory watcher forconfig.srcDir(or otherwise triggeringdidBuild/ctx.rebuild()on non-bundled file changes).
const ctx = await esbuild.context(resolvedOptions);
await ctx.watch();
- Files reviewed: 2/2 changed files
- Comments generated: 4
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
DonJayamanne
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should be good to use now and also lets us benefit from incremental builds. In my testing the memory and cpu usage seems reasonable but will keep an eye on this