minify_html 0.3.12 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +15 -14
- data/lib/linux-ruby2.5 +0 -0
- data/lib/linux-ruby2.6 +0 -0
- data/lib/linux-ruby2.7 +0 -0
- data/lib/macos-ruby2.5 +0 -0
- data/lib/macos-ruby2.6 +0 -0
- data/lib/macos-ruby2.7 +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4516f4975352060d252dc72ff441080f341114b8277cff7b62a3303a613279b7
|
4
|
+
data.tar.gz: 514facfe0ecb340f180d5b9c220291e59d375d5069bbda85bfbe9ceec08ce0dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c01002c64c63b3d83cc1b3a783b3e0ea782dbdda32685a0b0a8d9e9559c938d851d45ddaa2a22efc99bdade52f6791248a115174b7a0089ec1a3e2f800588d5
|
7
|
+
data.tar.gz: 85fa35d7d9e6f4c93211ea60f79d2a39b1177e9278ac4180efce136231b2d98bfbf1ef5a9ce2916878cf414c3b88bc7ed675f6a495c8772723318a0bec95ed00
|
data/README.md
CHANGED
@@ -6,13 +6,13 @@ Comes with native bindings to Node.js, Python, Java, and Ruby.
|
|
6
6
|
- Advanced minification strategy beats other minifiers with only one pass.
|
7
7
|
- Uses zero memory allocations, SIMD searching, direct tries, and lookup tables.
|
8
8
|
- Well tested with a large test suite and extensive [fuzzing](./fuzz).
|
9
|
-
- Natively binds to [esbuild](https://github.com/wilsonzlin/esbuild-rs) for super fast JS minification.
|
9
|
+
- Natively binds to [esbuild](https://github.com/wilsonzlin/esbuild-rs) for super fast JS and CSS minification.
|
10
10
|
|
11
11
|
## Performance
|
12
12
|
|
13
13
|
Comparison with [html-minfier](https://github.com/kangax/html-minifier) and [minimize](https://github.com/Swaagie/minimize), run on the top web pages. [See the breakdown here.](./bench)
|
14
14
|
|
15
|
-
<img width="415" alt="Chart showing speed of HTML minifiers" src="https://wilsonl.in/minify-html/bench/0.
|
15
|
+
<img width="415" alt="Chart showing speed of HTML minifiers" src="https://wilsonl.in/minify-html/bench/0.4.1/js/average-speeds.png"> <img width="415" alt="Chart showing effectiveness of HTML minifiers" src="https://wilsonl.in/minify-html/bench/0.4.1/js/average-sizes.png">
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
@@ -22,16 +22,16 @@ Precompiled binaries are available for x86-64 Linux, macOS, and Windows.
|
|
22
22
|
|
23
23
|
##### Get
|
24
24
|
|
25
|
-
[Linux](https://wilsonl.in/minify-html/bin/0.
|
26
|
-
[macOS](https://wilsonl.in/minify-html/bin/0.
|
27
|
-
[Windows](https://wilsonl.in/minify-html/bin/0.
|
25
|
+
[Linux](https://wilsonl.in/minify-html/bin/0.4.1-linux-x86_64) |
|
26
|
+
[macOS](https://wilsonl.in/minify-html/bin/0.4.1-macos-x86_64) |
|
27
|
+
[Windows](https://wilsonl.in/minify-html/bin/0.4.1-windows-x86_64.exe)
|
28
28
|
|
29
29
|
##### Use
|
30
30
|
|
31
31
|
Use the `--help` argument for more details.
|
32
32
|
|
33
33
|
```bash
|
34
|
-
minify-html --src /path/to/src.html --out /path/to/output.min.html
|
34
|
+
minify-html --src /path/to/src.html --out /path/to/output.min.html --css --js
|
35
35
|
```
|
36
36
|
|
37
37
|
### API
|
@@ -43,12 +43,12 @@ minify-html --src /path/to/src.html --out /path/to/output.min.html
|
|
43
43
|
|
44
44
|
```toml
|
45
45
|
[dependencies]
|
46
|
-
minify-html = { version = "0.
|
46
|
+
minify-html = { version = "0.4.1", features = ["js-esbuild"] }
|
47
47
|
```
|
48
48
|
|
49
|
-
Building with the `js-esbuild` feature requires the Go compiler to be installed as well, to build the [JS minifier](https://github.com/wilsonzlin/esbuild-rs).
|
49
|
+
Building with the `js-esbuild` feature requires the Go compiler to be installed as well, to build the [JS and CSS minifier](https://github.com/wilsonzlin/esbuild-rs).
|
50
50
|
|
51
|
-
If the `js-esbuild` feature is not enabled, `cfg.minify_js` will have no effect.
|
51
|
+
If the `js-esbuild` feature is not enabled, `cfg.minify_js` and `cfg.minify_css` will have no effect.
|
52
52
|
|
53
53
|
##### Use
|
54
54
|
|
@@ -82,7 +82,7 @@ yarn add @minify-html/js
|
|
82
82
|
```js
|
83
83
|
const minifyHtml = require("@minify-html/js");
|
84
84
|
|
85
|
-
const cfg = minifyHtml.createConfiguration({ minifyJs: false });
|
85
|
+
const cfg = minifyHtml.createConfiguration({ minifyJs: false, minifyCss: false });
|
86
86
|
const minified = minifyHtml.minify("<p> Hello, world! </p>", cfg);
|
87
87
|
|
88
88
|
// Alternatively, minify in place to avoid copying.
|
@@ -97,7 +97,7 @@ minify-html is also available for TypeScript:
|
|
97
97
|
import * as minifyHtml from "@minify-html/js";
|
98
98
|
import * as fs from "fs";
|
99
99
|
|
100
|
-
const cfg = minifyHtml.createConfiguration({ minifyJs: false });
|
100
|
+
const cfg = minifyHtml.createConfiguration({ minifyJs: false, minifyCss: false });
|
101
101
|
const minified = minifyHtml.minify("<p> Hello, world! </p>", cfg);
|
102
102
|
// Or alternatively:
|
103
103
|
const minified = minifyHtml.minifyInPlace(fs.readFileSync("source.html"), cfg);
|
@@ -120,7 +120,7 @@ Add as a Maven dependency:
|
|
120
120
|
<dependency>
|
121
121
|
<groupId>in.wilsonl.minifyhtml</groupId>
|
122
122
|
<artifactId>minify-html</artifactId>
|
123
|
-
<version>0.
|
123
|
+
<version>0.4.1</version>
|
124
124
|
</dependency>
|
125
125
|
```
|
126
126
|
|
@@ -133,6 +133,7 @@ import in.wilsonl.minifyhtml.SyntaxException;
|
|
133
133
|
|
134
134
|
Configuration cfg = new Configuration.Builder()
|
135
135
|
.setMinifyJs(false)
|
136
|
+
.setMinifyCss(false)
|
136
137
|
.build();
|
137
138
|
|
138
139
|
try {
|
@@ -165,7 +166,7 @@ Add the PyPI project as a dependency and install it using `pip` or `pipenv`.
|
|
165
166
|
import minify_html
|
166
167
|
|
167
168
|
try:
|
168
|
-
minified = minify_html.minify("<p> Hello, world! </p>", minify_js=False)
|
169
|
+
minified = minify_html.minify("<p> Hello, world! </p>", minify_js=False, minify_css=False)
|
169
170
|
except SyntaxError as e:
|
170
171
|
print(e)
|
171
172
|
```
|
@@ -188,7 +189,7 @@ Add the library as a dependency to `Gemfile` or `*.gemspec`.
|
|
188
189
|
```ruby
|
189
190
|
require 'minify_html'
|
190
191
|
|
191
|
-
print MinifyHtml.minify("<p> Hello, world! </p>", { :minify_js => false })
|
192
|
+
print MinifyHtml.minify("<p> Hello, world! </p>", { :minify_js => false, :minify_css => false })
|
192
193
|
```
|
193
194
|
|
194
195
|
</details>
|
data/lib/linux-ruby2.5
CHANGED
Binary file
|
data/lib/linux-ruby2.6
CHANGED
Binary file
|
data/lib/linux-ruby2.7
CHANGED
Binary file
|
data/lib/macos-ruby2.5
CHANGED
Binary file
|
data/lib/macos-ruby2.6
CHANGED
Binary file
|
data/lib/macos-ruby2.7
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minify_html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wilson Lin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fiddle
|
@@ -62,5 +62,5 @@ rubyforge_project:
|
|
62
62
|
rubygems_version: 2.7.6.2
|
63
63
|
signing_key:
|
64
64
|
specification_version: 4
|
65
|
-
summary:
|
65
|
+
summary: Extremely fast and smart HTML + JS + CSS minifier
|
66
66
|
test_files: []
|