Skip to content

Conversation

matthewbastien
Copy link
Contributor

@matthewbastien matthewbastien commented Sep 24, 2025

The most recent version of the lldb-dap VS Code extension (0.2.17) fails to activate because it's missing the chokidar dependency in the .vsix. In order to prevent this from happening in the future, this PR adds a bundle-extension step to extension packaging in order to bundle the extension into a single .js file using esbuild. All dependencies will be included in this bundle so that the .vscodeignore doesn't need to be updated.

@llvmbot
Copy link
Member

llvmbot commented Sep 24, 2025

@llvm/pr-subscribers-lldb

Author: Matthew Bastien (matthewbastien)

Changes

The most recent version of the lldb-dap extension (0.2.17) fails to activate because it's missing the chokidar dependency in the .vsix. In order to prevent this from happening in the future, this PR adds a bundle-extension step to extension packaging in order to bundle the extension into a single .js file using esbuild. All dependencies will be included in this bundle so that the .vscodeignoe doesn't need to be updated.


Full diff: https://github.com/llvm/llvm-project/pull/160598.diff

1 Files Affected:

  • (modified) lldb/tools/lldb-dap/package.json (+3-2)
diff --git a/lldb/tools/lldb-dap/package.json b/lldb/tools/lldb-dap/package.json
index cba48569d167e..46fd30a15b016 100644
--- a/lldb/tools/lldb-dap/package.json
+++ b/lldb/tools/lldb-dap/package.json
@@ -49,13 +49,14 @@
   ],
   "main": "./out/extension",
   "scripts": {
+    "bundle-extension": "npx tsc -p ./ --noEmit && npx esbuild src-ts/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node --target=node22 --minify --sourcemap",
     "bundle-symbols-table-view": "npx tsc -p src-ts/webview --noEmit && npx esbuild src-ts/webview/symbols-table-view.ts --bundle --format=iife --outdir=./out/webview",
     "bundle-tabulator": "cp node_modules/tabulator-tables/dist/js/tabulator.min.js ./out/webview/ && cp node_modules/tabulator-tables/dist/css/tabulator_midnight.min.css ./out/webview/ && cp node_modules/tabulator-tables/dist/css/tabulator_simple.min.css ./out/webview/",
     "bundle-webview": "npm run bundle-symbols-table-view && npm run bundle-tabulator",
-    "vscode:prepublish": "npm run bundle-webview && tsc -p ./",
+    "vscode:prepublish": "npm run bundle-webview && npm run bundle-extension",
     "watch": "npm run bundle-webview && tsc -watch -p ./",
     "format": "npx prettier './src-ts/' --write",
-    "package": "rm -rf ./out/lldb-dap.vsix && vsce package --out ./out/lldb-dap.vsix",
+    "package": "rm -rf ./out && vsce package --out ./out/lldb-dap.vsix",
     "publish": "vsce publish",
     "vscode-uninstall": "code --uninstall-extension llvm-vs-code-extensions.lldb-dap",
     "vscode-install": "code --install-extension ./out/lldb-dap.vsix"

@JDevlieghere JDevlieghere merged commit 2a5c6e1 into llvm:main Sep 24, 2025
9 checks passed
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
The most recent version of the lldb-dap VS Code extension (0.2.17) fails
to activate because it's missing the `chokidar` dependency in the
`.vsix`. In order to prevent this from happening in the future, this PR
adds a `bundle-extension` step to extension packaging in order to bundle
the extension into a single `.js` file using esbuild. All dependencies
will be included in this bundle so that the `.vscodeignore` doesn't need
to be updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants