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.
This extension is thoroughly tested across multiple VS Code versions to ensure compatibility:
- 1.90.0 (Minimum): Engine requirement baseline - tested on macOS, Ubuntu, and Windows
- Stable: Current production release - tested on all platforms
- Insiders: Pre-release builds - tested on Ubuntu for early compatibility validation
Minify File through context menu
Minify and Save as New File through context menu
- CSS and JavaScript Minification: Minify open CSS and JS files in the editor using commands from the command palette or the context menu.
- Size Reduction Statistics: See exactly how much space you saved with percentage reduction and before/after file sizes.
- Minify to New File: Save the minified file to a new file with the
.minsuffix (e.g.,file.min.cssorfile.min.js). - Automatic Minification on Save: Configure the extension to automatically minify CSS and JS files when saving them.
- Intuitive Commands: Easily access minification features through the command palette and the editor's context menu.
- File Size Validation: Automatically validates files are under the 5MB API limit before processing.
- Enhanced Error Handling: Clear, actionable error messages for various failure scenarios including syntax errors, rate limits, and connectivity issues.
Minify: Minifies the current CSS or JS file and overwrites its content.Minify and Save as New File: Minifies the current CSS or JS file and saves the result to a new file with the.minsuffix.
The extension uses Toptal's free minification APIs with the following limitations:
- Maximum file size: 5MB per request
- Rate limit: 30 requests per minute
- Supported formats: CSS and JavaScript only
- Content type:
application/x-www-form-urlencoded
Enhanced Error Messages:
- File too large: Clear indication when files exceed 5MB limit with current file size
- Syntax errors: Detailed error messages for invalid CSS/JavaScript syntax
- Rate limiting: Informative message when hitting the 30 requests/minute limit
- Network issues: Specific guidance for connectivity problems vs. API timeouts
- Invalid content: Helpful feedback for unsupported file types or empty files
You can customize the extension's behavior through the available settings in VS Code:
css-js-minifier.minifyOnSave: Automatically minify CSS and JS files when saving them. (trueorfalse, default isfalse).css-js-minifier.minifyInNewFile: Save the minified content to a new file instead of overwriting the original. (trueorfalse, default isfalse).css-js-minifier.minifiedNewFilePrefix: Specify a custom prefix for the new minified file. (default is.min).css-js-minifier.autoOpenNewFile: Automatically open newly created minified files in the editor. (trueorfalse, default istrue).css-js-minifier.showSizeReduction: Show size reduction statistics in success messages. (trueorfalse, default istrue).
To adjust these settings, add the following lines to your settings.json file:
{
"css-js-minifier.minifyOnSave": true,
"css-js-minifier.minifyInNewFile": true,
"css-js-minifier.minifiedNewFilePrefix": ".min",
"css-js-minifier.autoOpenNewFile": false,
"css-js-minifier.showSizeReduction": true
}The extension is fully internationalized and supports 7 languages:
- πΊπΈ English (en) - Default
- πͺπΈ Spanish (es)
- π«π· French (fr)
- π©πͺ German (de)
- π§π· Portuguese (Brazil) (pt-br)
- π―π΅ Japanese (ja)
- π¨π³ Chinese Simplified (zh-cn)
The extension automatically uses your VS Code display language. All user-facing text is translated, including:
- Commands and menu items
- Configuration settings and descriptions
- Error messages and notifications
- Success messages
To use the extension in your preferred language:
-
Install Language Pack (if not already installed):
- Open Command Palette (
Ctrl/Cmd+Shift+P) - Type
Configure Display Language - Click
Install additional languages... - Search for and install your language pack (e.g., "Spanish Language Pack")
- Open Command Palette (
-
Switch VS Code Language:
- Open Command Palette (
Ctrl/Cmd+Shift+P) - Type
Configure Display Language - Select your preferred language from the list
- Restart VS Code when prompted
- Open Command Palette (
-
Verify:
- After restarting, open a CSS or JS file
- Right-click in the editor
- The extension commands should appear in your selected language
For more information about internationalization, see the Internationalization Documentation.
The extension provides convenient keyboard shortcuts for quick access to its commands:
Minify:alt+ctrl+m(Windows/Linux)option+ctrl+m(Mac)
Minify and Save as New File:alt+ctrl+n(Windows/Linux)option+ctrl+n(Mac)
- Open VS Code.
- Go to the Extensions view by clicking the Extensions icon in the Activity Bar on the side of the window or by pressing
Ctrl+Shift+X(Windows/Linux) orCmd+Shift+X(Mac) - Search for "
CSS & JS Minifier". - Click Install.
- Open a CSS or JS file in VS Code.
- Use the command palette (
Ctrl+Shift+PorCmd+Shift+Pon Mac) and type Minify to access the minification commands. - Alternatively, right-click within the editor and select the desired minification option from the context menu.
For detailed technical documentation, see the docs/ directory:
- Architecture Guide - Extension design and modular structure
- Testing Guide - Test strategies and rate limiting solutions
- API Integration - Toptal API implementation details
- Internationalization - Multi-language support and translation architecture
- Publishing Workflow - Release and deployment processes
Contributions are welcome! Feel free to open issues or submit pull requests on the GitHub repository.
Please review the technical documentation in the docs/ directory for implementation details and testing guidelines.
This extension is licensed under the MIT License.
All notable changes to the "css-js-minifier" extension will be documented in this file. Change Log

