Auto compile SCSS to CSS and minify/obfuscate JavaScript on save, with source map support.
Features
- SCSS → CSS — Compiles
.scssto.min.csswith source map on save - JS Minify — Compresses JavaScript, strips
console.log/cm.log, outputs.min.jswith source map - JS Obfuscate — Right-click menu to encrypt JS files with control flow flattening and string array transformation
- CSS Minify — Right-click menu to compress CSS files, generating
.min.cssand source map - Source Maps — Generates
.mapfiles for both CSS and JS debugging - Zero Config — Works immediately after installation; all features are toggleable via settings
How It Works
When you save a .scss or .js file, the extension automatically processes it:
styles/
├── main.scss ← save this
├── main.min.css ← generated
└── main.min.css.map ← generated
scripts/
├── app.js ← save this
├── app.min.js ← generated (minified)
└── app.min.js.map ← generated
Files ending in .min.js are skipped to avoid re-processing. Files inside node_modules are always excluded.
Build Tool Detection
The extension automatically detects if your project uses other build tools. If any of the following build tool configuration files exist in your project root, the automatic SCSS/JS processing will be skipped:
- Webpack:
webpack.config.js,webpack.config.ts - Vite:
vite.config.js,vite.config.ts,vite.config.mjs - Rollup:
rollup.config.js,rollup.config.ts - Parcel:
.parcelrc - Gulp:
gulpfile.js,gulpfile.ts - Grunt:
Gruntfile.js,Gruntfile.ts - Snowpack:
snowpack.config.js,snowpack.config.mjs - ESBuild:
esbuild.config.js,esbuild.config.ts
This prevents conflicts with your project's existing build pipeline.
Right-click Menu: JS Obfuscation
Right-click a .js file in the explorer and select 🍑JS加密 to compress and obfuscate it:
- Terser compresses the code and strips debug statements
- javascript-obfuscator applies control flow flattening and string array transformation
- Output is saved as
.min.jsin the same directory
Right-click Menu: CSS Minification
Right-click a .css file in the explorer and select 🍑CSS压缩 to compress it:
- Terser compresses the CSS code
- Generates
.min.cssfile and corresponding.min.css.mapsource map - Output is saved as
.min.cssin the same directory
Extension Settings
| Setting | Default | Description |
|---|---|---|
mini-js-scss.enabled |
true |
Enable/disable the extension globally |
mini-js-scss.scss.enabled |
true |
Enable/disable SCSS compilation |
mini-js-scss.js.enabled |
true |
Enable/disable JS processing |
mini-js-scss.logFunctions |
["console.log", "cm.log"] |
Function calls to strip during JS compression |
Config Example
Add custom log functions for removal:
"mini-js-scss.logFunctions": ["console.log", "console.warn", "cm.log", "debug.log"]
Requirements
- VS Code 1.80+
- No external prerequisites —
sass,terser,javascript-obfuscatorare bundled with the extension.
Dependencies
| Package | Purpose |
|---|---|
| sass | SCSS to CSS compilation |
| terser | JavaScript minification and debug statement removal |
| javascript-obfuscator | JavaScript obfuscation |
Release Notes
1.0.1
- Optimized activation events for better VS Code startup performance
- Changed from
"*"activation to specific events:onCommand,onLanguage:scss,onLanguage:javascript - Extension now only activates when needed (opening SCSS/JS files or using context menu commands)
1.0.0
- SCSS compilation with source maps
- JS minification (via terser) with
console.log/cm.logstripping - JS obfuscation (via javascript-obfuscator)
- Right-click menu 🍑JS加密 command
- Right-click menu 🍑CSS压缩 command
- Configurable via VS Code settings
node_modulesexclusion
Known Issues
- Obfuscation is CPU-intensive; very large JS files may cause a brief pause during save.
- The obfuscator runs synchronously after terser completes. This may be made async in a future release.