Skip to content

Commit c0d956c

Browse files
matthewbastienmahesh-attarde
authored andcommitted
[lldb-dap] bundle lldb-dap extension using esbuild (llvm#160598)
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.
1 parent 5075623 commit c0d956c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lldb/tools/lldb-dap/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@
4949
],
5050
"main": "./out/extension",
5151
"scripts": {
52+
"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",
5253
"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",
5354
"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/",
5455
"bundle-webview": "npm run bundle-symbols-table-view && npm run bundle-tabulator",
55-
"vscode:prepublish": "npm run bundle-webview && tsc -p ./",
56+
"vscode:prepublish": "npm run bundle-webview && npm run bundle-extension",
5657
"watch": "npm run bundle-webview && tsc -watch -p ./",
5758
"format": "npx prettier './src-ts/' --write",
58-
"package": "rm -rf ./out/lldb-dap.vsix && vsce package --out ./out/lldb-dap.vsix",
59+
"package": "rm -rf ./out && vsce package --out ./out/lldb-dap.vsix",
5960
"publish": "vsce publish",
6061
"vscode-uninstall": "code --uninstall-extension llvm-vs-code-extensions.lldb-dap",
6162
"vscode-install": "code --install-extension ./out/lldb-dap.vsix"

0 commit comments

Comments
 (0)