htmlnano 1.1.1 → 2.0.0

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
 
6
+ ## [2.0.0] - 2022-01-12
7
+ *The major version has to be released because of vulnerability in PostCSS (see [#165])*
8
+
9
+ ### Changed
10
+ - Support optional dependencies [#168] (`minifyUrl`, ` minifyJs`, `removeUnusedCss`, `minifyCss`). *This might be a breaking change for you*. Check the docs: https://github.com/posthtml/htmlnano/pull/168/files
11
+ - Disable `mergeScripts` & `mergeStyles` in the safe preset [#170].
12
+
13
+
6
14
  ## [1.1.1] - 2021-09-19
7
15
  This version fixes fatal errors introduced in [1.1.0].
8
16
 
@@ -225,6 +233,7 @@ Otherwise, you have to adapt the config according to the new [PurgeCSS@3](https:
225
233
  - Remove attributes that contains only white spaces.
226
234
 
227
235
 
236
+ [2.0.0]: https://github.com/posthtml/htmlnano/compare/1.1.1...2.0.0
228
237
  [1.1.1]: https://github.com/posthtml/htmlnano/compare/1.1.0...1.1.1
229
238
  [1.1.0]: https://github.com/posthtml/htmlnano/compare/1.0.1...1.1.0
230
239
  [1.0.1]: https://github.com/posthtml/htmlnano/compare/1.0.0...1.0.1
@@ -250,6 +259,9 @@ Otherwise, you have to adapt the config according to the new [PurgeCSS@3](https:
250
259
  [0.1.2]: https://github.com/posthtml/htmlnano/compare/0.1.1...0.1.2
251
260
  [0.1.1]: https://github.com/posthtml/htmlnano/compare/0.1.0...0.1.1
252
261
 
262
+ [#170]: https://github.com/posthtml/htmlnano/issues/170
263
+ [#168]: https://github.com/posthtml/htmlnano/issues/168
264
+ [#165]: https://github.com/posthtml/htmlnano/issues/165
253
265
  [#163]: https://github.com/posthtml/htmlnano/issues/163
254
266
  [#161]: https://github.com/posthtml/htmlnano/issues/161
255
267
  [#159]: https://github.com/posthtml/htmlnano/issues/159
package/README.md CHANGED
@@ -4,22 +4,17 @@
4
4
 
5
5
  Modular HTML minifier, built on top of the [PostHTML](https://github.com/posthtml/posthtml). Inspired by [cssnano](http://cssnano.co/).
6
6
 
7
- To switch to the optional fork of uncss, apply `uncss-fork.patch`.
8
-
9
- Reasons you may want to do this are: uncss uses outdated dependencies with security issues
10
-
11
- Reasons you may want to avoid this are: long term support, stability
12
-
13
7
  ## [Benchmark](https://github.com/maltsev/html-minifiers-benchmark/blob/master/README.md)
14
- [html-minifier-terser@5.1.1]: https://www.npmjs.com/package/html-minifier-terser
15
- [htmlnano@1.0.0]: https://www.npmjs.com/package/htmlnano
8
+ [html-minifier-terser@6.0.2]: https://www.npmjs.com/package/html-minifier-terser
9
+ [htmlnano@1.1.1]: https://www.npmjs.com/package/htmlnano
16
10
 
17
- | Website | Source (KB) | [html-minifier-terser@5.1.1] | [htmlnano@1.0.0] |
11
+ | Website | Source (KB) | [html-minifier-terser@6.0.2] | [htmlnano@1.1.1] |
18
12
  |---------|------------:|----------------:|-----------:|
19
- | [stackoverflow.blog](https://stackoverflow.blog/) | 95 | 87 | 82 |
20
- | [github.com](https://github.com/) | 210 | 183 | 171 |
21
- | [en.wikipedia.org](https://en.wikipedia.org/wiki/Main_Page) | 78 | 72 | 72 |
22
- | [npmjs.com](https://www.npmjs.com/features) | 41 | 38 | 36 |
13
+ | [stackoverflow.blog](https://stackoverflow.blog/) | 90 | 82 | 76 |
14
+ | [github.com](https://github.com/) | 232 | 203 | 173 |
15
+ | [en.wikipedia.org](https://en.wikipedia.org/wiki/Main_Page) | 81 | 76 | 75 |
16
+ | [npmjs.com](https://www.npmjs.com/features) | 43 | 40 | 38 |
17
+ | [tc39.es](https://tc39.es/ecma262/) | 6001 | 5465 | 5459 |
23
18
  | **Avg. minify rate** | 0% | **9%** | **13%** |
24
19
 
25
20
 
@@ -203,6 +203,19 @@ or [PurgeCSS](https://github.com/FullHuman/purgecss).
203
203
 
204
204
  #### With uncss
205
205
 
206
+ You have to install `uncss` in order to use this feature:
207
+
208
+ ```bash
209
+ npm install --save-dev uncss
210
+ # if you prefer yarn
211
+ # yarn add --dev uncss
212
+ # if you prefer pnpm
213
+ # pnpm install --save-dev uncss
214
+ ```
215
+
216
+ You can also use a mainted fork [@novaatwarren/uncss](https://www.npmjs.com/package/@novaatwarren/uncss) instead.
217
+
218
+
206
219
  ##### Options
207
220
  See [the documentation of uncss](https://github.com/uncss/uncss) for all supported options.
208
221
 
@@ -225,6 +238,16 @@ The following uncss options are ignored if passed to the module:
225
238
 
226
239
  Use PurgeCSS instead of uncss by adding `tool: 'purgeCSS'` to the options.
227
240
 
241
+ You have to install `purgecss` in order to use this feature:
242
+
243
+ ```bash
244
+ npm install --save-dev purgecss
245
+ # if you prefer yarn
246
+ # yarn add --dev purgecss
247
+ # if you prefer pnpm
248
+ # pnpm install --save-dev purgecss
249
+ ```
250
+
228
251
  ##### Options
229
252
 
230
253
  See [the documentation of PurgeCSS](https://www.purgecss.com) for all supported options.
@@ -275,8 +298,18 @@ Optimized:
275
298
  ### minifyCss
276
299
  Minifies CSS with [cssnano](http://cssnano.co/) inside `<style>` tags and `style` attributes.
277
300
 
301
+ You have to install `cssnano` and `postcss` in order to use this feature:
302
+
303
+ ```bash
304
+ npm install --save-dev cssnano postcss
305
+ # if you prefer yarn
306
+ # yarn add --dev cssnano postcss
307
+ # if you prefer pnpm
308
+ # pnpm install --save-dev cssnano postcss
309
+ ```
310
+
278
311
  #### Options
279
- See [the documentation of cssnano](http://cssnano.co/optimisations/) for all supported optimizations.
312
+ See [the documentation of cssnano](http://cssnano.co/docs/optimisations/) for all supported optimizations.
280
313
  By default CSS is minified with preset `default`, which shouldn't have any side-effects.
281
314
 
282
315
  To use another preset or disabled some optimizations pass options to `minifyCss` module:
@@ -316,6 +349,16 @@ Minified:
316
349
  ### minifyJs
317
350
  Minifies JS using [Terser](https://github.com/fabiosantoscode/terser) inside `<script>` tags.
318
351
 
352
+ You have to install `terser` in order to use this feature:
353
+
354
+ ```bash
355
+ npm install --save-dev terser
356
+ # if you prefer yarn
357
+ # yarn add --dev terser
358
+ # if you prefer pnpm
359
+ # pnpm install --save-dev terser
360
+ ```
361
+
319
362
  #### Options
320
363
  See [the documentation of Terser](https://github.com/fabiosantoscode/terser#api-reference) for all supported options.
321
364
  Terser options can be passed directly to the `minifyJs` module:
@@ -664,6 +707,16 @@ Processed:
664
707
  ### minifyUrls
665
708
  Convert absolute URL to relative URL using [relateurl](https://www.npmjs.com/package/relateurl).
666
709
 
710
+ You have to install `relateurl`, `terser` and `srcset` in order to use this feature:
711
+
712
+ ```bash
713
+ npm install --save-dev relateurl terser srcset
714
+ # if you prefer yarn
715
+ # yarn add --dev relateurl terser srcset
716
+ # if you prefer pnpm
717
+ # pnpm install --save-dev relateurl terser srcset
718
+ ```
719
+
667
720
  #### Options
668
721
 
669
722
  The base URL to resolve against. Support `String` & `URL`.
@@ -783,4 +836,3 @@ Minified:
783
836
  ```html
784
837
  <form method="get"></form>
785
838
  ```
786
-