diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9ba2b8..fd8d9ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -27,5 +27,6 @@ jobs: working-directory: docs - name: Test docs build + if: always() run: npm run build working-directory: docs diff --git a/CHANGELOG.md b/CHANGELOG.md index bb87872..f1dbadd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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]. @@ -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 @@ -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 diff --git a/README.md b/README.md index b03ea3d..b638266 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/docs/050-modules.md b/docs/docs/050-modules.md index 7ffe992..44bf650 100644 --- a/docs/docs/050-modules.md +++ b/docs/docs/050-modules.md @@ -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. @@ -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. @@ -275,6 +298,16 @@ Optimized: ### minifyCss Minifies CSS with [cssnano](http://cssnano.co/) inside ` + + +``` + +Minified (with `all`): +```html +