Skip to content

About

VSCode extension to minify CSS and JS.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Minify CSS/JS (VS Code Extension)

A custom, vibe coded, VS Code extension to minify CSS and JavaScript files.

Why this extension?

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.

Features

  • Minify current active .css or .js file.
  • Minify all .css and .js files 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 exists behavior.

Commands

  • Minify CSS/JS: Minify Current File
  • Minify CSS/JS: Minify Workspace Files

Settings

  • minifyCssJs.outputDirectory: output folder relative to workspace root.
  • minifyCssJs.workspaceInclude: workspace-only glob patterns to search for when using Minify Workspace Files.
  • minifyCssJs.workspaceExclude: additional workspace-only glob patterns to exclude when using Minify Workspace Files.
  • minifyCssJs.generateJsSourceMap: yes, no, or If exists for JS source maps.
  • minifyCssJs.generateCssSourceMap: yes, no, or If exists for CSS source maps.
  • minifyCssJs.cssInlineImports: inline CSS imports before minification.
  • minifyCssJs.autoMinifyOnSaveIfMinExists: auto-minify on save only when corresponding .min file already exists.

Minify Workspace Files always excludes .min.css, .min.js, and node_modules, even if you change the workspace include patterns.

Development

npm install
npm test
npm run build

This 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.

Releases

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 Summary

Workspace runs end with a short notification. If any files fail, details are written to the Minify CSS/JS output channel and shown automatically.

About

VSCode extension to minify CSS and JS.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages