Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Virgo MinifierNew to Visual Studio Code? Get it now.
Virgo Minifier

Virgo Minifier

Virgo Internet Services Ltd.

|
2 installs
| (0) | Free
Automatic and manual minification for CSS, JS, HTML, JSON, XML, and SVG files with real-time file system monitoring
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Virgo Minifier

The 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.

Features

Supported File Types

File Type Extensions Minification Engine
CSS .css clean-css
JavaScript .js, .mjs, .cjs terser
HTML .html, .htm html-minifier-terser
JSON .json Native JSON parser
XML .xml Custom XML minifier
SVG .svg Optimized SVG minifier

Key Features

  • Automatic Minification: Files are automatically minified when saved or created
  • Real-Time File Watching: Monitors file system events including saves, creates, and copies
  • Intelligent Debouncing: Prevents duplicate minifications during rapid file operations
  • Context Menu Integration: Right-click any supported file or folder to minify instantly
  • Bulk Operations: Minify entire folders or workspaces with a single command
  • Flexible Output Options: Create .min.* files or overwrite originals
  • Per-Type Configuration: Enable/disable minification for specific file types
  • Exclude Patterns: Skip files and folders using glob patterns
  • License Preservation: Optionally preserve copyright/license comments
  • Source Map Support: Generate source maps for JavaScript debugging
  • Progress Indicators: Visual feedback in status bar during operations
  • Detailed Logging: Comprehensive output channel for troubleshooting

Installation

Visual Studio Code

  1. Open Visual Studio Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "Virgo Minifier"
  4. Click Install

Cursor

Virgo Minifier is available on the Open VSX Registry, which Cursor uses by default:

  1. Open Cursor
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "Virgo Minifier"
  4. Click Install

Windsurf

Virgo Minifier is available on the Open VSX Registry, which Windsurf uses by default:

  1. Open Windsurf
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "Virgo Minifier"
  4. Click Install

Google Antigravity

Virgo Minifier is available on the Open VSX Registry, which Antigravity uses by default:

  1. Open Antigravity
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "Virgo Minifier"
  4. Click Install

Quick Start

  1. Install the extension
  2. Open a workspace containing your web project
  3. Create a configuration file (optional but recommended):
    • Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
    • Run Virgo Minifier: Create Configuration File
  4. Start coding! Files will be automatically minified on save

That's it! Virgo Minifier works out of the box with sensible defaults.

Configuration

Virgo Minifier uses a .virgo-minifier.json configuration file in your workspace root. This file allows you to customize every aspect of the minification process.

Creating the Configuration File

You can create a configuration file in two ways:

  1. Using the Command Palette:

    • Press Ctrl+Shift+P (or Cmd+Shift+P on macOS)
    • Type and select Virgo Minifier: Create Configuration File
  2. Manually: Create a .virgo-minifier.json file in your workspace root

Configuration Options

Here's a complete example with all available options:

{
    "autoMinify": true,
    "minifyOnSave": true,
    "minifyOnCreate": true,
    "showNotificationOnAutoSave": false,
    "notificationDuration": 3,

    "minifyCSS": true,
    "minifyJS": true,
    "minifyHTML": true,
    "minifyJSON": true,
    "minifyXML": true,
    "minifySVG": true,

    "outputSuffix": ".min",
    "overwriteOriginal": false,
    "outputDir": "",

    "removeComments": true,
    "preserveLicense": true,
    "preserveLineBreaks": false,

    "skipMinified": true,

    "cssOptions": {
        "level": 2,
        "format": "none",
        "compatibility": "*"
    },

    "jsOptions": {
        "compress": true,
        "mangle": true,
        "sourceMap": false,
        "keepFunctionNames": false,
        "keepClassNames": false
    },

    "htmlOptions": {
        "collapseWhitespace": true,
        "removeAttributeQuotes": false,
        "removeOptionalTags": false,
        "minifyCSS": true,
        "minifyJS": true
    },

    "exclude": [
        "node_modules/**",
        "*.min.*",
        "dist/**",
        "build/**",
        "out/**",
        "src/**",
        ".vscode/**",
        ".git/**",
        ".virgo-minifier.json"
    ]
}

Option Reference

General Options

Option Type Default Description
autoMinify boolean true Enable/disable automatic minification
minifyOnSave boolean true Minify files when they are saved
minifyOnCreate boolean true Minify files when they are created or copied
showNotificationOnAutoSave boolean false Show status bar notification after auto-minification
notificationDuration number 3 Duration in seconds to show notifications
skipMinified boolean true Skip files that are already minified (.min.*)

File Type Options

Option Type Default Description
minifyCSS boolean true Enable CSS minification
minifyJS boolean true Enable JavaScript minification
minifyHTML boolean true Enable HTML minification
minifyJSON boolean true Enable JSON minification
minifyXML boolean true Enable XML minification
minifySVG boolean true Enable SVG minification

Output Options

Option Type Default Description
outputSuffix string ".min" Suffix added to minified filenames (e.g., style.css → style.min.css)
overwriteOriginal boolean false If true, overwrites the original file instead of creating a new one
outputDir string "" Custom output directory for minified files (relative to source file's folder)

Comment Options

Option Type Default Description
removeComments boolean true Remove all comments from minified output
preserveLicense boolean true Preserve license/copyright comments at the top of files
preserveLineBreaks boolean false Keep some line breaks for readability

CSS-Specific Options (cssOptions)

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

  1. Auto-minify on save: Enable autoMinify to automatically create minified versions as you work
  2. Preview production size: See real-time file size savings in the output log
  3. Source maps for debugging: Enable jsOptions.sourceMap to debug minified JavaScript

Build Integration

  1. Set outputDir to your build folder (e.g., "dist")
  2. Keep overwriteOriginal: false to preserve source files
  3. Use exclude patterns to skip test files and development assets

Legacy Project Migration

  1. Use the Minify Workspace command to bulk-process existing files
  2. Configure exclude patterns to skip third-party libraries
  3. Set preserveLicense: true to 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:

  1. Ensure autoMinify: true in your config
  2. Verify the file type is enabled (e.g., minifyCSS: true)
  3. Check that the file doesn't match an exclude pattern
  4. Make sure virgoMinifier.enable is true in 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:

  1. Open SVG as text: Right-click the SVG file → Open With... → Text Editor, then save with Ctrl+S
  2. Use context menu: Right-click the SVG file in Explorer → Minify with Virgo Minifier
  3. 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:

  1. The file isn't already minified (.min.*)
  2. The content contains minifiable elements (whitespace, comments, etc.)

Q: I'm getting syntax errors after minification

A: Try these solutions:

  1. Ensure your source file has valid syntax
  2. For JavaScript, try setting mangle: false in jsOptions
  3. For CSS, reduce level to 1 for safer optimizations

Viewing Logs

  1. Open the Output panel (View → Output)
  2. Select "Virgo Minifier" from the dropdown
  3. 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:

Buy Me A Coffee


Enjoy using Virgo Minifier! If you find it helpful, please consider leaving a review on your marketplace of choice.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft