A VSIX package is a ZIP archive that follows the Open Packaging Conventions (OPC). Microsoft’s documentation says the file names inside must not have spaces or characters reserved in URIs, and that the package is what Visual Studio uses to classify and install the extensions it holds.
Members
ZIP[Content_Types].xmlrequired by OPC: the media type of each kind of filerequiredZIPextension.vsixmanifestthe manifestrequiredZIPextension/… in a VS Code package, the extension’s folderVS CodeZIPOther files in a Visual Studio package, the assemblies, templates and other assets the manifest listsVisual Studio
| Member | What it is |
|---|---|
[Content_Types].xml | The media types of the package’s files. |
extension.vsixmanifest | The package manifest. The name is fixed. |
extension/package.json | A VS Code extension’s own manifest. |
extension/README.md, CHANGELOG.md, LICENSE and so on | Documents named by the manifest’s assets. |
extension/package.nls.json | Translated strings for package.json values written as %key%. |
| Other files | Code, grammars, themes, images and whatever else the extension ships. |
[Content_Types].xml
The Open Packaging Conventions require this member. Its root is Types
in the namespace http://schemas.openxmlformats.org/package/2006/content-types.
It holds a Default element for each file extension, and may hold an
Override for a single part.
VS Code’s packager, vsce, writes one Default element per
file extension in the package, with the extension written with a leading dot. It
always includes .json and .vsixmanifest. Other media types
come from the mime library, and the entries are sorted so the output is
reproducible.
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default Extension=".json" ContentType="application/json"/>
<Default Extension=".vsixmanifest" ContentType="text/xml"/>
<Default Extension=".js" ContentType="application/javascript"/>
</Types>
| Element | Attribute | Meaning |
|---|---|---|
Default | Extension | The file extension this entry covers. |
Default | ContentType | The media type of files with that extension. |
Override | PartName | The name of one part, from the root. |
Override | ContentType | The media type of that part. |
Platform-specific packages
From VS Code 1.61.0 a package can be built for one platform, with the
--target option of vsce. The target is written in the
manifest as the TargetPlatform attribute of Identity. A
package with no target is the fallback for platforms that have no package of their
own. The targets are:
| Target | Target |
|---|---|
win32-x64 | alpine-x64 |
win32-arm64 | alpine-arm64 |
linux-x64 | darwin-x64 |
linux-arm64 | darwin-arm64 |
linux-armhf | web |
web uses the browser entry point in
package.json.
Signatures
vsce signs a package by writing separate files beside it, not inside
it: .signature.manifest, .signature.p7s and
.signature.zip.