Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Auto-MinifyNew to Visual Studio Code? Get it now.
Auto-Minify

Auto-Minify

CaffeineOnIce

|
3,083 installs
| (3) | Free
Automatically minify your HTML, CSS, and JS files on save
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Auto Minify Extension for VSCode

Automatically minify your HTML, CSS, and JS files to optimize space and bandwidth usage.

Features

  • Automatically generates a .min.html, .min.css, or .min.js file each time you save a .html, .css, or .js file. For example: styles.css becomes styles.min.css.

Basic Usage

  1. Create an .html, .css, or .js file.
  2. Press Ctrl/Cmd + S to save your file.
  3. A corresponding .min.html, .min.css, or .min.js file is automatically generated.
  4. You will see a temporary "HTML Compiled," "CSS Compiled," or "JS Compiled" message in the status bar.

Dependencies Utilized

  • HTML: html-minifier-terser
  • CSS: clean-css
  • JS: terser

Please check the changelog for version updates.

Heads-Up

  • This extension was created because the my previously used minifier, Minify, had not been updated for a while and appears to be abandoned. This is an improved version.
  • Any errors encountered during minification are likely caused by the underlying dependencies.
  • If you have any feature requests or suggestions, please submit them in the Issues tab; your input is highly appreciated.

Note: Any additional options not provided below are defaulted to their respective values in their original code.

html-minifier-terser Options Utilized:

{
    "removeAttributeQuotes": true,
    "removeComments": true,
    "removeEmptyElements": true,
    "removeOptionalTags": true,
    "removeRedundantAttributes": true,

    "collapseWhitespace": true,
    "conservativeCollapse": true,

    "caseSensitive": true,
    "continueOnParseError": true,
    "collapseBooleanAttributes": true,
    "processConditionalComments": true,

    "minifyCSS": true,
    "minifyJS": true,
    "html5": true
}

clean-css Options Utilized:

{
	"level": {
		"1": {
			"all": true
		}
	}
}

terser Options Utilized:

{
	"mangle": false
}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft