A CLI tool that minifies all JavaScript files in a folder into a single output file using the terser minifier (v5.18.1). It supports configurable glob patterns, per-file minification, comment preservation, and custom output extensions. Current stable version is 3.3.0, released June 2023. Updated regularly to track terser releases. Key differentiator: batch processing of entire folders with flexible output options, unlike single-file minifiers.
npm install uglifyjs-folderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows installing the package globally, creating two JS test files, and minifying the folder into a single bundle file.
If using programmatic API, update code to use async/await. The CLI interface unchanged.
Remove any calls to uglify-js specific options; terser is mostly compatible but check config file keys.
Remove --harmony from CLI commands; terser handles ES6+ by default.
Use a different output folder or extension (e.g., -x .min.js).
Run `npm install -g uglifyjs-folder` to install globally, or `npm install --save-dev uglifyjs-folder` for local and use npx.
Ensure npm global bin directory is in PATH, or use `npx uglifyjs-folder`.
Check CLI syntax: `uglifyjs-folder src -o output.min.js`.