Skip to content

Commit e967c32

Browse files
authored
Merge pull request #171 from posthtml/v2
Release 2.0.0
2 parents dd33f2b + 8b8379f commit e967c32

28 files changed

+16964
-112
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
12-
node-version: ['12', '14', '16']
12+
node-version: ['14', '16']
1313

1414
steps:
1515
- uses: actions/checkout@v2
@@ -27,5 +27,6 @@ jobs:
2727
working-directory: docs
2828

2929
- name: Test docs build
30+
if: always()
3031
run: npm run build
3132
working-directory: docs

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55

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+
614
## [1.1.1] - 2021-09-19
715
This version fixes fatal errors introduced in [1.1.0].
816

@@ -225,6 +233,7 @@ Otherwise, you have to adapt the config according to the new [PurgeCSS@3](https:
225233
- Remove attributes that contains only white spaces.
226234

227235

236+
[2.0.0]: https://github.com/posthtml/htmlnano/compare/1.1.1...2.0.0
228237
[1.1.1]: https://github.com/posthtml/htmlnano/compare/1.1.0...1.1.1
229238
[1.1.0]: https://github.com/posthtml/htmlnano/compare/1.0.1...1.1.0
230239
[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:
250259
[0.1.2]: https://github.com/posthtml/htmlnano/compare/0.1.1...0.1.2
251260
[0.1.1]: https://github.com/posthtml/htmlnano/compare/0.1.0...0.1.1
252261

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
253265
[#163]: https://github.com/posthtml/htmlnano/issues/163
254266
[#161]: https://github.com/posthtml/htmlnano/issues/161
255267
[#159]: https://github.com/posthtml/htmlnano/issues/159

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
Modular HTML minifier, built on top of the [PostHTML](https://github.com/posthtml/posthtml). Inspired by [cssnano](http://cssnano.co/).
66

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-
137
## [Benchmark](https://github.com/maltsev/html-minifiers-benchmark/blob/master/README.md)
148
[[email protected]]: https://www.npmjs.com/package/html-minifier-terser
159
[[email protected]]: https://www.npmjs.com/package/htmlnano

docs/docs/050-modules.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,19 @@ or [PurgeCSS](https://github.com/FullHuman/purgecss).
203203

204204
#### With uncss
205205

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+
206219
##### Options
207220
See [the documentation of uncss](https://github.com/uncss/uncss) for all supported options.
208221

@@ -225,6 +238,16 @@ The following uncss options are ignored if passed to the module:
225238

226239
Use PurgeCSS instead of uncss by adding `tool: 'purgeCSS'` to the options.
227240

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+
228251
##### Options
229252

230253
See [the documentation of PurgeCSS](https://www.purgecss.com) for all supported options.
@@ -275,6 +298,16 @@ Optimized:
275298
### minifyCss
276299
Minifies CSS with [cssnano](http://cssnano.co/) inside `<style>` tags and `style` attributes.
277300

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+
278311
#### Options
279312
See [the documentation of cssnano](http://cssnano.co/docs/optimisations/) for all supported optimizations.
280313
By default CSS is minified with preset `default`, which shouldn't have any side-effects.
@@ -316,6 +349,16 @@ Minified:
316349
### minifyJs
317350
Minifies JS using [Terser](https://github.com/fabiosantoscode/terser) inside `<script>` tags.
318351

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+
319362
#### Options
320363
See [the documentation of Terser](https://github.com/fabiosantoscode/terser#api-reference) for all supported options.
321364
Terser options can be passed directly to the `minifyJs` module:
@@ -664,6 +707,16 @@ Processed:
664707
### minifyUrls
665708
Convert absolute URL to relative URL using [relateurl](https://www.npmjs.com/package/relateurl).
666709

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+
667720
#### Options
668721

669722
The base URL to resolve against. Support `String` & `URL`.
@@ -783,4 +836,3 @@ Minified:
783836
```html
784837
<form method="get"></form>
785838
```
786-

0 commit comments

Comments
 (0)