# rollup-plugin-minify-html-template-literals

> Minifies HTML template literal strings

Latest version **1.2.0** (published 2020-09-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install rollup-plugin-minify-html-template-literals
pnpm add rollup-plugin-minify-html-template-literals
yarn add rollup-plugin-minify-html-template-literals
bun add rollup-plugin-minify-html-template-literals
```

## Health

**Score 40/100 (D)** — status: abandoned.

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

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2020-09-01 |
| First published | 2020-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | exuanbo |
| Maintainers | exuanbo |
| Keywords | rollup, rollup-plugin, minify, html, template, literals, template-literals, lit-html |

## Links

- npm: https://www.npmjs.com/package/rollup-plugin-minify-html-template-literals
- Repository: https://github.com/exuanbo/rollup-plugin-minify-html-template-literals
- Homepage: https://github.com/exuanbo/rollup-plugin-minify-html-template-literals#readme
- Issues: https://github.com/exuanbo/rollup-plugin-minify-html-template-literals/issues
- npm.io page: https://npm.io/package/rollup-plugin-minify-html-template-literals

## Dependencies (2)

- [@rollup/pluginutils](https://npm.io/package/@rollup/pluginutils.md) ^4.0.0
- [minify-html-literals](https://npm.io/package/minify-html-literals.md) ^1.3.2

## 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

- 1.2.0 (latest) — 2020-09-01
- 1.1.0 — 2020-08-30
- 1.0.3 — 2020-08-29
- 1.0.2 — 2020-08-26
- 1.0.1 — 2020-08-24
- 1.0.0 — 2020-08-24

## README

# rollup-plugin-minify-html-template-literals

> Minifies HTML template literal strings

[![npm](https://img.shields.io/npm/v/rollup-plugin-minify-html-template-literals.svg?style=flat-square)](https://www.npmjs.com/package/rollup-plugin-minify-html-template-literals)
[![Travis CI](https://img.shields.io/travis/com/exuanbo/rollup-plugin-minify-html-template-literals/master.svg?style=flat-square)](https://travis-ci.com/github/exuanbo/rollup-plugin-minify-html-template-literals)
[![David](https://img.shields.io/david/exuanbo/rollup-plugin-minify-html-template-literals.svg?style=flat-square)](https://david-dm.org/exuanbo/rollup-plugin-minify-html-template-literals)
[![License](https://img.shields.io/github/license/exuanbo/rollup-plugin-minify-html-template-literals.svg?style=flat-square)](https://github.com/exuanbo/rollup-plugin-minify-html-template-literals/blob/master/LICENSE)

Uses [minify-html-literals](https://www.npmjs.com/package/minify-html-literals) to minify HTML and CSS markup inside JavaScript template literal strings.

This plugin supports Rollup v2.

## Install

```bash
npm install --save-dev rollup-plugin-minify-html-template-literals
```

## Usage

```js
import minifyHTML from 'rollup-plugin-minify-html-template-literals'
import babel from '@rollup/plugin-babel'
import { terser } from 'rollup-plugin-terser'

export default {
  input: 'index.js',
  output: { file: 'dist/index.js' },
  plugins: [
    minifyHTML(),
    // Order this plugin before other transpilers and minifiers
    babel(),
    terser()
  ]
}
```

By default, this will minify any tagged template literal string whose tag contains "html" or "css" (case insensitive). [Additional options](https://www.npmjs.com/package/minify-html-literals#options) may be specified to control what templates should be minified.

## Options

```ts
declare const pluginOptions {
  /**
  * A picomatch pattern, or array of patterns, which specifies the files in the build the plugin should operate on.
  */
  include?: ReadonlyArray<string | RegExp> | string | RegExp | null
  /**
  * A picomatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore.
  */
  exclude?: typeof pluginOptions.include
  /**
  * Minify options, see https://www.npmjs.com/package/minify-html-literals#options.
  */
  options?: DefaultOptions
}
```

## License

[MIT](https://github.com/exuanbo/rollup-plugin-minify-html-template-literals/blob/master/LICENSE)

## Donate

<a href="https://www.buymeacoffee.com/exuanbo" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/lato-orange.png" alt="Buy Me A Coffee" height="38.25px" width="162.75px"></a>

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