A π©π¦ππΌπ±π² πΊπΆπ»πΆπ³πΆπ²πΏ for JS, JSON/C, CSS, and HTML, you will love its simplicity! π πΎπ€π’π₯π§ππ¨π¨ and ππ―ππ₯ files and folders π¦ Reduce your bundle and file sizes with lightning speed β‘
GPL-3.0 License
Simple VS Code minifier and compressor for most common file types (See full list below). You will love its simplicity!
You can minify the file and replace all the content with the new minified text, or you can preserve the original document and get the minified text in another document! Also, you can simply minify your selected text, you can preserve your licence comments with the tags @preserve and @endpreserve.
MinifyAll is also able to compress files and folders simply by right-clicking them on the menu.
Go to the extension settings and make it as you want, enable or disable: minify on save, languages, hexadecimal shortener, messages, and much more.
For more information check our: GitHub repository, VisualStudio Marketplace or OpenVSX registry.
Also check the brand new MinifyAll online webpage π or the MinifyAllCli/package.
Do you want to help us improve the extension or did you found a bug? Let us know.
Check our CHANGELOG.
Currently looking for active contributors to maintain and keep the project alive.
We support up to 14 languages/file extensions!
ext install josee9988.minifyall
Minify this document β‘
Or CTRL+ALT+M
Minify this document and preserve the original β
Or CTRL+ALT+N
Minify the selected text π―
Or CTRL+ALT+. CTRL+ALT+M
We recommend using them with: "left click" on the document and then select the option you want, either the file in the menu or the opened file. ;)
(Remember to restart VS Code after modifying any configuration)
"MinifyAll.disableHexadecimalShortener": true|false //default 'true' (by default it is disabled)
"MinifyAll.disableMessages": true|false //default 'false' (by default it is allowed)
"MinifyAll.disableCodeContextMenu": true|false //default 'false' (by default it is shown)
"MinifyAll.disableFileExplorerContextMenu": true|false //default 'false' (by default it is shown)
"MinifyAll.minifyOnSave": true|false //default 'false' (by default it is disabled)
"MinifyAll.minifyOnSaveToNewFile": true|false //default 'false' (by default it is disabled)
"MinifyAll.PrefixOfNewMinifiedFiles": '-min'|'.min'|'-minified'|'.minified' //default '-min'
"MinifyAll.openMinifiedDocument": true|false //default 'true'
"MinifyAll.terserMinifyOptions": { "mangle": true, "compress": { "drop_console": true, "dead_code": false, "keep_fnames": false, "keep_classnames": false } } // for more information please visit https://github.com/terser/terser#minify-options
"MinifyAll.disableHtml": true|false //default 'false' (by default it is enabled)
"MinifyAll.disableTwig": true|false //default 'false' (by default it is enabled)
"MinifyAll.disablePhp": true|false //default 'false' (by default it is enabled)
"MinifyAll.disableCss": true|false //default 'false' (by default it is enabled)
"MinifyAll.disableScss": true|false //default 'false' (by default it is enabled)
"MinifyAll.disableLess": true|false //default 'false' (by default it is enabled)
"MinifyAll.disableSass": true|false //default 'false' (by default it is enabled)
"MinifyAll.disableJson": true|false //default 'false' (by default it is enabled)
"MinifyAll.disableJsonc": true|false //default 'false' (by default it is enabled)
"MinifyAll.disableJavascript": true|false //default 'false' (by default it is enabled)
"MinifyAll.disableJavascriptReact": true|false //default 'true' (by default it is enabled)
"MinifyAll.disableXml": true|false //default 'false'
From:
.myClass {
background-color: rgba(12, 12, 12, 0.8);
background-color: rgb(12, 12, 12);
background-color: #FAFAFA;
/*other comment*/
content: url("https://github.com/Josee9988/MinifyAll");
margin-right: 0px;
}/* my comment
*/
To:
.myClass{background-color:#0C0C0CCC;background-color:#111;background-color:#FFF;content:url("https://github.com/Josee9988/MinifyAll");margin-right:0}
From:
{
"contributes": {
"commands": [{
"title": "Minify this document β‘",
},
{
"color": "#FAFAFA", // comments
}/* multiline comment
*/
]
}
}
To:
{"contributes":{"commands":[{"title":"Minify this document β‘"},{"color":"#FFF"}]}}
From:
"use strict";
const {
commands,
window
} = require('vscode');
const FileSaver = require('fs')
const StringWithComments = "// not a comment /*" //this is my comment
if ((window.activeTextEditor.document.languageId == "css" && disableCss == false) || //myComment
(window.activeTextEditor.document.languageId == "scss" && disableScss == false)) {
const {
document
} = window.activeTextEditor;
switch (window.activeTextEditor.document.languageId) {
case "css":
/*
multi-line comments
*/
console.log("Love this minifier !!!")
break;
default:
break;
}
}
To:
"use strict";const{commands,window}=require('vscode');const FileSaver=require('fs')
const StringWithComments="// not a comment /*"
if((window.activeTextEditor.document.languageId=="css"&&disableCss==false)||(window.activeTextEditor.document.languageId=="scss"&&disableScss==false)){const{document}=window.activeTextEditor;switch(window.activeTextEditor.document.languageId){case"css":console.log("Love this minifier !!!")
break;default:break;}}let myString="hello//";myString.replace(/\/\//g,'');
From:
<!DOCTYPE html>
<html lang="es">
<head>
<title></title>
<meta charset="utf-8">
<link rel="stylesheet" href="">
<script type="text/javascript' src=""></script>
<!-- test -->
</head>
<!-- ~~~~~β¦β¦β¦β¦β¦ B O
D Y β¦β¦β¦β¦β¦~~~~~ -->
<body>
</body>
</html>
To:
<!DOCTYPE html><html lang="es"><head><title></title><meta charset="utf-8"><link rel="stylesheet"href=""><script type="text/javascript"src=""></script></head><body></body></html>
Support the project and be the first donator β€οΈ
Check my VS Code Markdown and Changelog snippets π
Check my MinifyAll online webpage π
β οΈRemember that this extension does not guarantee 100% effectiveness and may have some issue at some point. Use it at your own risk and always do backups of your code.β οΈ
Made with a lot of β€οΈβ€οΈ by @Josee9988