Automatically minify your HTML, CSS, and JS files to optimize space and bandwidth usage.
- 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
becomesstyles.min.css
.
- Create an
.html
,.css
, or.js
file. - Press
Ctrl/Cmd
+S
to save your file. - A corresponding
.min.html
,.min.css
, or.min.js
file is automatically generated. - You will see a temporary "HTML Compiled," "CSS Compiled," or "JS Compiled" message in the status bar.
- HTML: html-minifier-terser
- CSS: clean-css
- JS: terser
Please check the changelog for version updates.
- 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.
{
"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
}
{
"level": {
"1": {
"all": true
}
}
}
{
"mangle": false
}