Virgo MinifierThe Ultimate File Minification Extension for Visual Studio Code Virgo Minifier is a powerful, feature-rich Visual Studio Code extension that provides automatic and manual minification capabilities for CSS, JavaScript, HTML, JSON, XML, and SVG files. With real-time file system monitoring, intelligent debouncing, and comprehensive configuration options, Virgo Minifier seamlessly integrates into your development workflow to optimize your web assets with zero friction. FeaturesSupported File Types
Key Features
InstallationVisual Studio Code
CursorVirgo Minifier is available on the Open VSX Registry, which Cursor uses by default:
WindsurfVirgo Minifier is available on the Open VSX Registry, which Windsurf uses by default:
Google AntigravityVirgo Minifier is available on the Open VSX Registry, which Antigravity uses by default:
Quick Start
That's it! Virgo Minifier works out of the box with sensible defaults. ConfigurationVirgo Minifier uses a Creating the Configuration FileYou can create a configuration file in two ways:
Configuration OptionsHere's a complete example with all available options:
Option ReferenceGeneral Options
File Type Options
Output Options
Comment Options
CSS-Specific Options (
|
| Option | Type | Default | Description |
|---|---|---|---|
level |
number | 2 |
Optimization level: 0 (no optimizations), 1 (safe optimizations), 2 (aggressive optimizations) |
format |
string | "none" |
Output format: "none" (minified), "beautify" (formatted), "keep-breaks" (preserve line breaks) |
compatibility |
string | "*" |
Browser compatibility mode (e.g., "ie11", "*" for all browsers) |
JavaScript-Specific Options (jsOptions)
| Option | Type | Default | Description |
|---|---|---|---|
compress |
boolean | true |
Enable compression (dead code removal, constant folding, etc.) |
mangle |
boolean | true |
Mangle variable and function names |
sourceMap |
boolean | false |
Generate source map files (.js.map) |
keepFunctionNames |
boolean | false |
Preserve function names (useful for stack traces) |
keepClassNames |
boolean | false |
Preserve class names |
HTML-Specific Options (htmlOptions)
| Option | Type | Default | Description |
|---|---|---|---|
collapseWhitespace |
boolean | true |
Remove unnecessary whitespace |
removeAttributeQuotes |
boolean | false |
Remove quotes around attribute values where possible |
removeOptionalTags |
boolean | false |
Remove optional HTML tags (e.g., </body>) |
minifyCSS |
boolean | true |
Minify inline CSS in <style> tags |
minifyJS |
boolean | true |
Minify inline JavaScript in <script> tags |
Exclude Patterns
The exclude option accepts an array of glob patterns to skip during minification:
{
"exclude": [
"node_modules/**",
"**/vendor/**",
"*.min.*",
"**/*.min.*",
"legacy/**/*.js",
"tests/**"
]
}
Commands
Access these commands via the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
| Command | Description |
|---|---|
Virgo Minifier: Minify Current File |
Minify the currently active file |
Virgo Minifier: Minify All Files in Workspace |
Minify all supported files in the workspace |
Virgo Minifier: Create Configuration File |
Create a .virgo-minifier.json file with defaults |
Virgo Minifier: Toggle Auto-Minify |
Enable/disable automatic minification |
Context Menu
Right-click any supported file or folder in the Explorer to access:
- Minify with Virgo Minifier - Minify the selected file
- Minify Folder with Virgo Minifier - Minify all supported files in the folder
VS Code Settings
In addition to the project-level .virgo-minifier.json file, you can configure global settings in VS Code:
{
"virgoMinifier.enable": true,
"virgoMinifier.showStatusBar": true
}
| Setting | Type | Default | Description |
|---|---|---|---|
virgoMinifier.enable |
boolean | true |
Enable/disable the extension globally |
virgoMinifier.showStatusBar |
boolean | true |
Show minification status in the status bar |
Status Bar
The status bar displays the current state of Virgo Minifier with real-time feedback:
| Icon | Meaning |
|---|---|
| ⚡ Virgo Minifier | Auto-minify is enabled |
| 🚫 Virgo Minifier | Auto-minify is disabled (yellow background) |
| 🔄 Minifying (n) | Minification in progress (n files) |
| ✓ filename.css -42.5% | Successful minification (file name + size reduction) |
| ⚠ filename.css | Minification failed (red background) |
After a successful minification, the status bar shows the file name and size reduction percentage for the configured notificationDuration (default: 3 seconds), then returns to the default state.
Click the status bar item to toggle auto-minify on/off.
Use Cases
Development Workflow
- Auto-minify on save: Enable
autoMinifyto automatically create minified versions as you work - Preview production size: See real-time file size savings in the output log
- Source maps for debugging: Enable
jsOptions.sourceMapto debug minified JavaScript
Build Integration
- Set
outputDirto your build folder (e.g.,"dist") - Keep
overwriteOriginal: falseto preserve source files - Use exclude patterns to skip test files and development assets
Legacy Project Migration
- Use the Minify Workspace command to bulk-process existing files
- Configure
excludepatterns to skip third-party libraries - Set
preserveLicense: trueto keep copyright notices
Performance
Virgo Minifier is designed for optimal performance:
- Debounced file watching: Prevents duplicate operations during rapid saves
- Configuration caching: Config files are cached for 5 seconds
- Concurrent processing: Multiple files can be processed simultaneously
- Incremental operation: Only changed files are reprocessed
Troubleshooting
Common Issues
Q: My files aren't being minified automatically
A: Check the following:
- Ensure
autoMinify: truein your config - Verify the file type is enabled (e.g.,
minifyCSS: true) - Check that the file doesn't match an exclude pattern
- Make sure
virgoMinifier.enableistruein VS Code settings
Q: SVG files are not minified when I press Ctrl+S
A: This is not a bug. VS Code opens SVG files in preview mode by default (showing the image visually), not as a text document. In preview mode, the save event is not triggered for text-based extensions.
Solutions:
- Open SVG as text: Right-click the SVG file →
Open With...→Text Editor, then save with Ctrl+S - Use context menu: Right-click the SVG file in Explorer →
Minify with Virgo Minifier - Set default editor (recommended): Add this to your VS Code settings to always open SVG files as text:
"workbench.editorAssociations": { "*.svg": "default" }
Q: The minified output is the same as the original
A: This can happen with already optimized files. Check:
- The file isn't already minified (
.min.*) - The content contains minifiable elements (whitespace, comments, etc.)
Q: I'm getting syntax errors after minification
A: Try these solutions:
- Ensure your source file has valid syntax
- For JavaScript, try setting
mangle: falseinjsOptions - For CSS, reduce
levelto1for safer optimizations
Viewing Logs
- Open the Output panel (View → Output)
- Select "Virgo Minifier" from the dropdown
- Review timestamped log entries for details
About Virgo Internet Services
Virgo Minifier is developed and maintained by Mustafa Odabaşı, Software Developer at Virgo Internet Services Ltd. — delivering high-quality web solutions since 1997.
📧 Contact: modabasi@virgo.com.tr
Support
If you find this extension useful, consider supporting its development:
Enjoy using Virgo Minifier! If you find it helpful, please consider leaving a review on your marketplace of choice.