A minimal VS Code extension that batch-converts selected image files to WebP by calling the cwebp binary.
- Convert one or many files from the Explorer context menu.
- Convert many files from the Command Palette via a file picker.
- Keep the original file basename and write
filename.webpbeside the source image. - Configure the
cwebpbinary path and default arguments in VS Code settings. - Optionally skip files when the target
.webpalready exists.
{
"cwebpRunner.binaryPath": "cwebp",
"cwebpRunner.defaultArgs": ["-q", "80", "-mt"],
"cwebpRunner.skipIfExists": true,
"cwebpRunner.supportedExtensions": [".png", ".jpg", ".jpeg", ".tif", ".tiff"]
}npm install
npm run compilePress F5 in VS Code to launch the Extension Development Host.
npm install
npm run compile
npx vsce package