As of now, there are some available extensions: for example Minify or JS & CSS Minifier

Note: You can find extensions on the VS Code Marketplace.

Or directly from VS Code by searching from the Extensions pane, on the left side (Ctrl + Shift + X).

Answer from Supersharp on Stack Overflow
🌐
Visual Studio Marketplace
marketplace.visualstudio.com β€Ί items
Minify - Visual Studio Marketplace
Extension for Visual Studio Code - Minify for VS Code. Minify with command, and (optionally) re-minify on save.
🌐
GitHub
github.com β€Ί CaffeineOnIce β€Ί AutoMinify
GitHub - CaffeineOnIce/AutoMinify: A VSCode extension to minify HTML, CSS and JS files.
A VSCode extension to minify HTML, CSS and JS files. - CaffeineOnIce/AutoMinify
Starred by 3 users
Forked by 2 users
Languages Β  JavaScript
🌐
Visual Studio Marketplace
marketplace.visualstudio.com β€Ί items
MinifyAll - Visual Studio Marketplace
Extension for Visual Studio Code - Minifier for JSON, CSS, HTML, XML, TWIG, LESS, SASS, SCSS, JavaScript, JSONC, and JavaScriptReact(testing). Compressor of files and folders. You will love its simplicity!
🌐
DEV Community
dev.to β€Ί aryaziai β€Ί minifying-code-shortcut-4d6c
Minify Code Automatically - DEV Community
April 12, 2021 - Modify the extension settings: ☐ Minify On Save β˜‘ Minify On Save To New File ☐ Open Minified Document -min Prefix on new minified file Note: You may also disable specific file extensions (i.e. HTML files)
🌐
GitHub
github.com β€Ί miguelcolmenares β€Ί css-js-minifier
GitHub - miguelcolmenares/css-js-minifier: The CSS & JS Minifier extension for Visual Studio Code allows you to minify CSS and JavaScript files directly from the editor. Using the minification service provided by Toptal, this extension makes it quick and easy to optimize your files.
The CSS & JS Minifier extension for Visual Studio Code allows you to minify CSS and JavaScript files directly from the editor. Using the minification service provided by Toptal, this extension makes it quick and easy to optimize your files.
Author Β  miguelcolmenares
🌐
GitHub
github.com β€Ί Josee9988 β€Ί MinifyAll
GitHub - Josee9988/MinifyAll: 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 ⚑
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 ⚑ - Josee9988/MinifyAll
Starred by 77 users
Forked by 15 users
Languages Β  TypeScript 90.8% | Shell 6.2% | JavaScript 3.0%
Find elsewhere
🌐
Visual Studio Marketplace
marketplace.visualstudio.com β€Ί items
JS & CSS Minifier (Minify) - Visual Studio Marketplace
Extension for Visual Studio Code - Easily Minify ES5/ES6/ES7/ES8 and CSS. Supports minify on save, minify selection & custom configurations!
🌐
Visual Studio Marketplace
marketplace.visualstudio.com β€Ί items
Auto-Minify - Visual Studio Marketplace
Extension for Visual Studio Code - Automatically minify your HTML, CSS, and JS files on save
🌐
Reddit
reddit.com β€Ί r/vscode β€Ί is there an extension to minify a selection? not an entire file, just what i have selected.
r/vscode on Reddit: Is there an extension to minify a selection? Not an entire file, just what I have selected.
September 26, 2019 - My use case is coding and editing HTML emails. If I style an element in chrome inspector, then copy and paste it into an editor, it's not inline and I have to do it manually or use something like https://www.willpeavy.com/tools/minifier/ which isn't very efficient. ... I've not been able to find anything like this. How sophisticated would you want it to be? I've made a few VSCode ...
🌐
Visual Studio Marketplace
marketplace.visualstudio.com β€Ί items
Minify HTML in PHP - Visual Studio Marketplace
Extension for Visual Studio Code - Minify HTML in PHP is a Visual Studio Code extension designed to automatically optimize HTML files and HTML code embedded within PHP files. This efficient tool removes unused spaces, tabs, and comments, effectively ...
🌐
GitHub
github.com β€Ί HookyQR β€Ί VSCodeMinify
GitHub - HookyQR/VSCodeMinify: Add minify function to VSCode 0.10+
Like beautify for VS Code, minify accepts an array for file extension that you will accept minification of under minify.JSfiles, minify.CSSfiles, and minify.HTMLfiles.
Starred by 55 users
Forked by 23 users
Languages Β  JavaScript
🌐
YouTube
youtube.com β€Ί webstylepress
Minify CSS, JavaScript, HTML easily right from Code Editor - YouTube
Why minification matters? When you write code, write comments as much as you can, use good naming conventions, use spaces and write beautiful code. This is f...
Published Β  February 8, 2021
Views Β  16K
🌐
YouTube
youtube.com β€Ί watch
How to Compress & Minify HTML,CSS & JS Files For Production in VS Code Using Minify Extension - YouTube
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
Published Β  October 6, 2024
🌐
YouTube
youtube.com β€Ί pixemweb
How To Beautify Your Code - Minify Your Code & Unminify Code - HTML | CSS | JavaScript - YouTube
In this video I show you How To Beautify your Code - Minify Your Code & Unminify Code Which is going to be helpful for HTML, CSS, CSS3 & JavaScript. I demons...
Published Β  August 13, 2017
Views Β  6K
🌐
GitHub
github.com β€Ί olback β€Ί es6-css-minify
GitHub - olback/es6-css-minify: Easily minify CSS and JavaScript in VS Code
Easily minify CSS and JavaScript in VS Code. Contribute to olback/es6-css-minify development by creating an account on GitHub.
Starred by 48 users
Forked by 13 users
Languages Β  TypeScript 91.8% | JavaScript 6.9% | CSS 1.3%
🌐
GitHub
github.com β€Ί microsoft β€Ί vscode β€Ί issues β€Ί 75194
Minifying feature to expand to cover the html Β· Issue #75194 Β· microsoft/vscode
In the real practices, we write full frameworks from the scratch, this is done almost in PHP (.php files) - and surely can be done in any other language - and the frameworks have html templates, static pages and so on... I was searching to find an extension that can minify the file itself, regardless of the extension of the files, and I found HTML-Minifier, but unfortunately it doesn't cover the case when the page includes <script> that's written in ECMA 6, so it minifies the .php files (that includes css styles and htmls) but neglects the javascript parts.