# contenthash-html-webpack-plugin

> Makes [contenthash] available for html-webpack-plugin

Latest version **1.0.2** (published 2017-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install contenthash-html-webpack-plugin
pnpm add contenthash-html-webpack-plugin
yarn add contenthash-html-webpack-plugin
bun add contenthash-html-webpack-plugin
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-08-31 |
| First published | 2017-08-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=4 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | kaelzhang |
| Maintainers | kael |
| Keywords | contenthash-html-webpack-plugin, html-webpack-plugin, contenthash, content-hash, compiler, compilation, webpack-plugin, webpack |

## Links

- npm: https://www.npmjs.com/package/contenthash-html-webpack-plugin
- Repository: https://github.com/kaelzhang/contenthash-html-webpack-plugin
- Homepage: https://github.com/kaelzhang/contenthash-html-webpack-plugin#readme
- Issues: https://github.com/kaelzhang/contenthash-html-webpack-plugin/issues
- npm.io page: https://npm.io/package/contenthash-html-webpack-plugin

## Dependencies (1)

- [hash-replace](https://npm.io/package/hash-replace.md) ^1.0.2

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-08-31
- 1.0.1 — 2017-08-31
- 1.0.0 — 2017-08-31

## README

[![Build Status](https://travis-ci.org/kaelzhang/contenthash-html-webpack-plugin.svg?branch=master)](https://travis-ci.org/kaelzhang/contenthash-html-webpack-plugin)
[![Coverage](https://codecov.io/gh/kaelzhang/contenthash-html-webpack-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/kaelzhang/contenthash-html-webpack-plugin)
<!-- optional appveyor tst
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/kaelzhang/contenthash-html-webpack-plugin?branch=master&svg=true)](https://ci.appveyor.com/project/kaelzhang/contenthash-html-webpack-plugin)
-->
<!-- optional npm version
[![NPM version](https://badge.fury.io/js/contenthash-html-webpack-plugin.svg)](http://badge.fury.io/js/contenthash-html-webpack-plugin)
-->
<!-- optional npm downloads
[![npm module downloads per month](http://img.shields.io/npm/dm/contenthash-html-webpack-plugin.svg)](https://www.npmjs.org/package/contenthash-html-webpack-plugin)
-->
<!-- optional dependency status
[![Dependency Status](https://david-dm.org/kaelzhang/contenthash-html-webpack-plugin.svg)](https://david-dm.org/kaelzhang/contenthash-html-webpack-plugin)
-->

# contenthash-html-webpack-plugin

Makes `[contenthash]` available for [html-webpack-plugin](https://www.npmjs.com/package/html-webpack-plugin)

## Install

```sh
$ npm install contenthash-html-webpack-plugin --save-dev
```

## Usage

```js
import ContentHashHtmlPlugin from 'contenthash-html-webpack-plugin'
import HtmlPlugin from 'html-webpack-plugin'

const webpackConfig = {
  ...,
  plugins: [
    new HtmlPlugin({
      filename: `[file]-[contenthash:16].html`,
      ...
    }),
    new ContentHashHtmlPlugin()
  ]
}

// Then the file hash will be the hash of the file content
```

## Available Placeholder Format

```js
'[contenthash]'
'[contenthash:7]'           // maxLength: 7
'[md5:contenthash:hex]'     // hashType: md5, digestType: hex

'[md5:contenthash:hex:7]'
// hashType: md5
// digestType: hex
// maxLength: 7
```

## License

MIT

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