1- # node-minify GitHub Action
1+ # node-minify GitHub Action (DEPRECATED)
22
3- Minify JavaScript, CSS, and HTML files in your CI/CD pipeline with detailed reporting.
3+ > ** This action is deprecated.** Please use the new bundled action instead:
4+ >
5+ > ``` yaml
6+ > - uses: srod/node-minify@v1
7+ > ```
48
5- ## Usage
9+ The new action includes :
10+ - Bundled dependencies (faster startup)
11+ - PR comment reporting
12+ - File annotations
13+ - Benchmark comparison
14+ - Threshold enforcement
15+ - More compressor options
616
7- ### Basic Example
17+ # # Migration
18+
19+ Replace :
820
921` ` ` yaml
10- - name : Minify JavaScript
11- uses : srod/node-minify/.github/actions/node-minify@main
22+ - uses: srod/node-minify/.github/actions/node-minify@main
23+ with:
24+ input: "src/app.js"
25+ output: "dist/app.min.js"
26+ compressor: "terser"
27+ ` ` `
28+
29+ With :
30+
31+ ` ` ` yaml
32+ - uses: srod/node-minify@v1
1233 with:
1334 input: "src/app.js"
1435 output: "dist/app.min.js"
1536 compressor: "terser"
1637` ` `
1738
18- ### With All Options
39+ # ## Removed Inputs
40+
41+ The following inputs are **not supported** in the new action and must be removed from your workflow YAML :
42+
43+ | Removed Input | Migration Guide |
44+ |---------------|-----------------|
45+ | `include-gzip` | Gzip sizes are now always included in the output. No action needed. |
46+ | `java-version` | Use `actions/setup-java@v4` before running the action (see example below). |
47+
48+ # ### Java Compressors Migration
49+
50+ If you use `gcc` or `yui` compressors that require Java :
51+
52+ **Before (deprecated):**
53+ ` ` ` yaml
54+ - uses: srod/node-minify/.github/actions/node-minify@main
55+ with:
56+ compressor: gcc
57+ java-version: "17"
58+ ` ` `
59+
60+ **After:**
61+ ` ` ` yaml
62+ - uses: actions/setup-java@v4
63+ with:
64+ distribution: 'temurin'
65+ java-version: '17'
66+
67+ - uses: srod/node-minify@v1
68+ with:
69+ compressor: gcc
70+ ` ` `
71+
72+ See [packages/action/README.md](../../../packages/action/README.md) for full documentation.
73+
74+ ---
75+
76+ # # Legacy Documentation
77+
78+ The following documentation is for the deprecated composite action.
79+
80+ # ## Basic Example
1981
2082` ` ` yaml
21- - name : Minify with full options
22- id : minify
83+ - name: Minify JavaScript
2384 uses: srod/node-minify/.github/actions/node-minify@main
2485 with:
2586 input: "src/app.js"
2687 output: "dist/app.min.js"
27- compressor : " esbuild"
28- type : " js"
29- options : ' {"minify": true}'
30- report-summary : " true"
31- include-gzip : " true"
32-
33- - name : Show results
34- run : |
35- echo "Reduction: ${{ steps.minify.outputs.reduction-percent }}%"
88+ compressor: "terser"
3689` ` `
3790
38- ## Inputs
91+ # ## Inputs
3992
4093| Input | Description | Required | Default |
4194|-------|-------------|----------|---------|
@@ -48,30 +101,7 @@ Minify JavaScript, CSS, and HTML files in your CI/CD pipeline with detailed repo
48101| `include-gzip` | Include gzip sizes | No | `true` |
49102| `java-version` | Java version for gcc/yui | No | - |
50103
51- # ## Available Compressors
52-
53- **JavaScript (no Java required):**
54- - ` terser` (recommended)
55- - ` esbuild` (fastest)
56- - ` swc`
57- - ` oxc`
58- - ` uglify-js`
59-
60- **CSS (no Java required):**
61- - ` lightningcss` (recommended)
62- - ` clean-css`
63- - ` cssnano`
64- - ` csso`
65- - ` esbuild`
66-
67- **HTML:**
68- - ` html-minifier`
69-
70- **Requires Java:**
71- - ` gcc` (Google Closure Compiler)
72- - ` yui` (deprecated)
73-
74- # # Outputs
104+ # ## Outputs
75105
76106| Output | Description |
77107|--------|-------------|
@@ -84,49 +114,6 @@ Minify JavaScript, CSS, and HTML files in your CI/CD pipeline with detailed repo
84114| `gzip-size-formatted` | Gzipped size formatted |
85115| `time-ms` | Compression time in milliseconds |
86116
87- # # Examples
88-
89- # ## CSS Minification
90-
91- ` ` ` yaml
92- - name: Minify CSS
93- uses: srod/node-minify/.github/actions/node-minify@main
94- with:
95- input: "src/styles.css"
96- output: "dist/styles.min.css"
97- compressor: "lightningcss"
98- type: "css"
99- ` ` `
100-
101- # ## Using Google Closure Compiler
102-
103- ` ` ` yaml
104- - name: Setup Java
105- uses: actions/setup-java@v4
106- with:
107- distribution: "temurin"
108- java-version: "17"
109-
110- - name: Minify with GCC
111- uses: srod/node-minify/.github/actions/node-minify@main
112- with:
113- input: "src/app.js"
114- output: "dist/app.min.js"
115- compressor: "gcc"
116- options: '{"compilation_level": "ADVANCED_OPTIMIZATIONS"}'
117- ` ` `
118-
119- # ## HTML Minification
120-
121- ` ` ` yaml
122- - name: Minify HTML
123- uses: srod/node-minify/.github/actions/node-minify@main
124- with:
125- input: "src/index.html"
126- output: "dist/index.html"
127- compressor: "html-minifier"
128- ` ` `
129-
130117# # License
131118
132119MIT
0 commit comments