# webpack-hash-sync

> sync the name of javascript file in the html file under the use of webpack

Latest version **0.1.4** (published 2017-04-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install webpack-hash-sync
pnpm add webpack-hash-sync
yarn add webpack-hash-sync
bun add webpack-hash-sync
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2017-04-07 |
| First published | 2017-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Xiaotao Nie |
| Maintainers | aircloud |
| Keywords | webpack, sync, nodejs, javascript |

## Links

- npm: https://www.npmjs.com/package/webpack-hash-sync
- Repository: https://github.com/aircloud/webpack-hash-sync
- Issues: https://github.com/aircloud/webpack-hash-sync/issues
- npm.io page: https://npm.io/package/webpack-hash-sync

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) >=3.5 <5
- [fs-extra](https://npm.io/package/fs-extra.md) ^0.30.0

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 0.1.4 (latest) — 2017-04-07
- 0.1.3 — 2017-03-28
- 0.1.2 — 2017-03-28
- 0.1.1 — 2017-03-27
- 0.1.0 — 2017-03-27

## README

### Instruction Of webpack-hash-sync

webpack-hash-sync is a plugin of webpack. It solves the problem that when we use the command webpack but the file name of javascript file linked by the html is not changed(We are willing to use hash or chunkhash so the name of the javascript file should be synchronized each time).

#### Download:

```
npm install webpack-hash-sync
```

#### Usage

the usage is easy:

```
//import
const WebpackHashSync = require('webpack-hash-sync');

//in the webpack config:

plugins: [
        //some other plugins...
        new WebpackHashSync({
	      		html:["index.html"],
	            file:["output.*?js","common.*?js"],
	            path:path.join(__dirname, 'public/'),
	            hash:true,
	            chunkhash:false
        }),
        //some other plugins...
],
```

then each time we use `webpack`, the file name of javascript file linked by the html will be synchronized automatically.

*When we use the webpack hot loading，it is also OK. Remember: sometimes we may reload the webpage otherwise we may get 404*

Finally it uses utf-8.

and there is the explaintion of the parameters :

| parameter | Optional | Default | description |
| ------| ------ | ------ | ------ |
| html | Necessary | [] | need to be an array, each is the name of the html file that is needed to be synchronized
| file | Necessary | [] | need to be an array, each is a regular expression of the name of js file |
| path | recommended | "" | the file path of the html file |
| hash | Optional | true | When we use hash, it should be true| 
| chunkhash | Optional | false | When we use chunkhash, it should be true| 


#### Problems

If you have problems, please visit [here](https://github.com/aircloud/webpack-hash-sync/issues) and I will handle the problem in at most 24 hours.

#### Github

https://github.com/aircloud/webpack-hash-sync

#### license

MIT

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