A custom, vibe coded, VS Code extension to minify CSS and JavaScript files.
This project is intended as a clean replacement for older minify extensions, with better handling of CSS @import via postcss-import.
Created because the minification extensions I found was missing support for @import and/or old and not updated.
Vibe coded because creating a VS Code extensions isn't my thing.
- Minify current active
.cssor.jsfile. - Minify all
.cssand.jsfiles in workspace. - CSS minification using
postcss+postcss-import+cssnano. - JavaScript minification using
terser. - Optional output directory.
- Optional workspace-only include and exclude glob filters.
- Optional JS and CSS source maps with
yes/no/If existsbehavior.
Minify CSS/JS: Minify Current FileMinify CSS/JS: Minify Workspace Files
minifyCssJs.outputDirectory: output folder relative to workspace root.minifyCssJs.workspaceInclude: workspace-only glob patterns to search for when usingMinify Workspace Files.minifyCssJs.workspaceExclude: additional workspace-only glob patterns to exclude when usingMinify Workspace Files.minifyCssJs.generateJsSourceMap:yes,no, orIf existsfor JS source maps.minifyCssJs.generateCssSourceMap:yes,no, orIf existsfor CSS source maps.minifyCssJs.cssInlineImports: inline CSS imports before minification.minifyCssJs.autoMinifyOnSaveIfMinExists: auto-minify on save only when corresponding.minfile already exists.
Minify Workspace Files always excludes .min.css, .min.js, and node_modules, even if you change the workspace include patterns.
npm install
npm test
npm run buildThis uses the pinned local vsce dependency from the project, so builds and releases use the same packaging tool version.
After build a vsix file is created which can be installed in VS Code.
Push a tag in the format vX.Y.Z that matches the version in package.json to trigger GitHub Actions.
The workflow builds the extension, creates a GitHub release, and uploads the generated .vsix file as a release asset.
Workspace runs end with a short notification. If any files fail, details are written to the Minify CSS/JS output channel and shown automatically.