Some checks failed
CI / build (push) Failing after 12s
GitOrigin-RevId: 6370f6ea785709295b6abcf9c60717cacf3ac432
1.3 KiB
1.3 KiB
VSCode Extension Build Tools
This directory contains Bazel rules and utilities for packaging VSCode extensions.
Contents
defs.bzl: Provides thevsce_extensionrule, which handles the staging and packaging of VSCode extensions usingvsce.vsce_wrapper.js: A Node.js wrapper for@vscode/vscethat handles runfiles resolution and polyfills necessary for running within a Bazel sandbox.BUILD.bazel: Defines the sharedvsce_toolbinary.
Usage
Load the vsce_extension rule in your extension's BUILD.bazel file:
load("//tools/vscode:defs.bzl", "vsce_extension")
vsce_extension(
name = "my_extension_vsix",
srcs = [
"package.json",
"README.md",
# ... other config files
],
extension_js = [":my_extension_bundle"], # Usually an esbuild target
out = "my-extension-0.0.1.vsix",
)
Why this exists
Packaging VSCode extensions via vsce typically requires a standard node_modules structure and often tries to run prepublish scripts. This tooling provides a way to:
- Package extensions without a local
node_modules. - Bypass mandatory
npmdependency checks and prepublish scripts by staging files manually. - Ensure the environment is correctly set up for
vsceto run inside a hermetic Bazel sandbox.