# snowpack-plugin-minify-html

> Minify HTML in production with Snowpack

Latest version **0.1.1** (published 2020-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install snowpack-plugin-minify-html
pnpm add snowpack-plugin-minify-html
yarn add snowpack-plugin-minify-html
bun add snowpack-plugin-minify-html
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-08-27 |
| First published | 2020-08-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 19.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Jared Lunde |
| Maintainers | jaredlunde |
| Keywords | snowpack plugin minify html, snowpack plugin, html-minifier |

## Links

- npm: https://www.npmjs.com/package/snowpack-plugin-minify-html
- Repository: https://github.com/jaredLunde/snowpack-plugin-minify-html
- Homepage: https://github.com/jaredLunde/snowpack-plugin-minify-html#readme
- Issues: https://github.com/jaredLunde/snowpack-plugin-minify-html/issues
- npm.io page: https://npm.io/package/snowpack-plugin-minify-html

## Dependencies (5)

- [glob](https://npm.io/package/glob.md) ^7.1.6
- [@types/glob](https://npm.io/package/@types/glob.md) ^7.1.3
- [html-minifier](https://npm.io/package/html-minifier.md) ^4.0.0
- [@rollup/pluginutils](https://npm.io/package/@rollup/pluginutils.md) ^4.0.0
- [@types/html-minifier](https://npm.io/package/@types/html-minifier.md) ^4.0.0

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2020-08-27

## README

<hr/>

# snowpack-plugin-minify-html

> Minify HTML in production using [html-minifier](https://github.com/kangax/html-minifier#readme) with Snowpack

```sh
npm i snowpack-plugin-minify-html
```

<p>
  <a aria-label="Types" href="https://www.npmjs.com/package/snowpack-plugin-minify-html">
    <img alt="Types" src="https://img.shields.io/npm/types/snowpack-plugin-minify-html?style=for-the-badge&labelColor=24292e">
  </a>
  <!--
  <a aria-label="Code coverage report" href="https://codecov.io/gh/jaredLunde/snowpack-plugin-terser">
    <img alt="Code coverage" src="https://img.shields.io/codecov/c/gh/jaredLunde/snowpack-plugin-terser?style=for-the-badge&labelColor=24292e">
  </a>
  -->
  <a aria-label="Build status" href="https://travis-ci.com/jaredLunde/snowpack-plugin-minify-html">
    <img alt="Build status" src="https://img.shields.io/travis/com/jaredLunde/snowpack-plugin-minify-html?style=for-the-badge&labelColor=24292e">
  </a>
  <a aria-label="NPM version" href="https://www.npmjs.com/package/snowpack-plugin-minify-html">
    <img alt="NPM Version" src="https://img.shields.io/npm/v/snowpack-plugin-minify-html?style=for-the-badge&labelColor=24292e">
  </a>
  <a aria-label="License" href="https://jaredlunde.mit-license.org/">
    <img alt="MIT License" src="https://img.shields.io/npm/l/snowpack-plugin-minify-html?style=for-the-badge&labelColor=24292e">
  </a>
</p>

---

## When to use this

You should only use this if you aren't already using a bundler (Webpack, Parcel, Rollup) to
build your production site.

## Quick start

```js
// snowpack.config.js
module.exports = {
  plugins: [
    [
      'snowpack-plugin-minify-html',
      {
        /**
         * @see Plugin Options below
         */
        htmlMinifierOptions: {
          sortAttributes: true,
          removeComments: true,
        },
      },
    ],
  ],
}
```

## Plugin Options

```ts
export interface SnowpackPluginHtmlMinifierOptions {
  /**
   * An array of glob patterns for files you want to explicitly include
   * for html-minifier minification. By default all HTML files are included.
   */
  include?: string[]
  /**
   * An array of glob patterns for files you want to exclude from
   * html-minifier minification
   */
  exclude?: string[]
  /**
   * html-minifier minify() options passed directly to html-minifier
   * @see https://github.com/kangax/html-minifier#options-quick-reference
   */
  htmlMinifierOptions?: htmlMinifier.Options
}
```

## LICENSE

MIT

---
_Source: https://npm.io/package/snowpack-plugin-minify-html · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
