Skip to content

Commit

Permalink
Merge pull request #171 from posthtml/v2
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
maltsev committed Jan 12, 2022
2 parents dd33f2b + 8b8379f commit e967c32
Show file tree
Hide file tree
Showing 28 changed files with 16,964 additions and 112 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: ['12', '14', '16']
node-version: ['14', '16']

steps:
- uses: actions/checkout@v2
Expand All @@ -27,5 +27,6 @@ jobs:
working-directory: docs

- name: Test docs build
if: always()
run: npm run build
working-directory: docs
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).


## [2.0.0] - 2022-01-12
*The major version has to be released because of vulnerability in PostCSS (see [#165])*

### Changed
- 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
- Disable `mergeScripts` & `mergeStyles` in the safe preset [#170].


## [1.1.1] - 2021-09-19
This version fixes fatal errors introduced in [1.1.0].

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


[2.0.0]: https://github.com/posthtml/htmlnano/compare/1.1.1...2.0.0
[1.1.1]: https://github.com/posthtml/htmlnano/compare/1.1.0...1.1.1
[1.1.0]: https://github.com/posthtml/htmlnano/compare/1.0.1...1.1.0
[1.0.1]: https://github.com/posthtml/htmlnano/compare/1.0.0...1.0.1
Expand All @@ -250,6 +259,9 @@ Otherwise, you have to adapt the config according to the new [PurgeCSS@3](https:
[0.1.2]: https://github.com/posthtml/htmlnano/compare/0.1.1...0.1.2
[0.1.1]: https://github.com/posthtml/htmlnano/compare/0.1.0...0.1.1

[#170]: https://github.com/posthtml/htmlnano/issues/170
[#168]: https://github.com/posthtml/htmlnano/issues/168
[#165]: https://github.com/posthtml/htmlnano/issues/165
[#163]: https://github.com/posthtml/htmlnano/issues/163
[#161]: https://github.com/posthtml/htmlnano/issues/161
[#159]: https://github.com/posthtml/htmlnano/issues/159
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@

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

To switch to the optional fork of uncss, apply `uncss-fork.patch`.

Reasons you may want to do this are: uncss uses outdated dependencies with security issues

Reasons you may want to avoid this are: long term support, stability

## [Benchmark](https://github.com/maltsev/html-minifiers-benchmark/blob/master/README.md)
[html-minifier-terser@6.0.2]: https://www.npmjs.com/package/html-minifier-terser
[htmlnano@1.1.1]: https://www.npmjs.com/package/htmlnano
Expand Down
54 changes: 53 additions & 1 deletion docs/docs/050-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,19 @@ or [PurgeCSS](https://github.com/FullHuman/purgecss).

#### With uncss

You have to install `uncss` in order to use this feature:

```bash
npm install --save-dev uncss
# if you prefer yarn
# yarn add --dev uncss
# if you prefer pnpm
# pnpm install --save-dev uncss
```

You can also use a mainted fork [@novaatwarren/uncss](https://www.npmjs.com/package/@novaatwarren/uncss) instead.


##### Options
See [the documentation of uncss](https://github.com/uncss/uncss) for all supported options.

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

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

You have to install `purgecss` in order to use this feature:

```bash
npm install --save-dev purgecss
# if you prefer yarn
# yarn add --dev purgecss
# if you prefer pnpm
# pnpm install --save-dev purgecss
```

##### Options

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

You have to install `cssnano` and `postcss` in order to use this feature:

```bash
npm install --save-dev cssnano postcss
# if you prefer yarn
# yarn add --dev cssnano postcss
# if you prefer pnpm
# pnpm install --save-dev cssnano postcss
```

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

You have to install `terser` in order to use this feature:

```bash
npm install --save-dev terser
# if you prefer yarn
# yarn add --dev terser
# if you prefer pnpm
# pnpm install --save-dev terser
```

#### Options
See [the documentation of Terser](https://github.com/fabiosantoscode/terser#api-reference) for all supported options.
Terser options can be passed directly to the `minifyJs` module:
Expand Down Expand Up @@ -664,6 +707,16 @@ Processed:
### minifyUrls
Convert absolute URL to relative URL using [relateurl](https://www.npmjs.com/package/relateurl).

You have to install `relateurl`, `terser` and `srcset` in order to use this feature:

```bash
npm install --save-dev relateurl terser srcset
# if you prefer yarn
# yarn add --dev relateurl terser srcset
# if you prefer pnpm
# pnpm install --save-dev relateurl terser srcset
```

#### Options

The base URL to resolve against. Support `String` & `URL`.
Expand Down Expand Up @@ -783,4 +836,3 @@ Minified:
```html
<form method="get"></form>
```

Loading

0 comments on commit e967c32

Please sign in to comment.