srod/node-minify
Minify JavaScript, CSS, and HTML files with detailed reporting and PR comments
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| input | Files to minify (glob pattern or path) | no | — |
| output | Output file path | no | — |
| auto | Enable zero-config auto mode | no | false |
| patterns | Custom glob patterns for auto mode (comma-separated) | no | — |
| output-dir | Output directory for auto mode | no | dist |
| ignore | Additional ignore patterns for auto mode (comma-separated) | no | — |
| dry-run | Preview mode - show what would be processed without minifying | no | false |
| compressor | Compressor to use. Recommended: terser, esbuild, swc, oxc (fast, no Java). Note: 'gcc' and 'yui' require Java (pre-installed on GitHub runners). | no | terser |
| type | File type: js or css (required for esbuild, yui) | no | — |
| options | Compressor-specific options (JSON string) | no | {} |
| report-summary | Add results to job summary | no | true |
| report-pr-comment | Post results as PR comment | no | false |
| report-annotations | Add file annotations for warnings | no | false |
| benchmark | Run benchmark comparison across compressors | no | false |
| benchmark-compressors | Compressors to compare (comma-separated) | no | terser,esbuild,swc,oxc |
| fail-on-increase | Fail if minified size is larger than original | no | false |
| min-reduction | Minimum reduction % required (0-100) | no | 0 |
| include-gzip | Include gzip sizes in report | no | true |
| working-directory | Working directory for file operations | no | . |
| github-token | GitHub token for PR comments | no | — |
Outputs
| name | description |
|---|---|
| original-size | Original file size in bytes |
| minified-size | Minified file size in bytes |
| reduction-percent | Size reduction percentage |
| gzip-size | Gzipped size in bytes |
| time-ms | Compression time in milliseconds |
| report-json | Full report as JSON string |
| benchmark-winner | Best compressor from benchmark (if run) |
| best-compression | Compressor with best compression ratio (if benchmark run) |
| best-speed | Fastest compressor (if benchmark run) |
| benchmark-json | Full benchmark results as JSON string |