# babel-plugin-react-intl-id-hash

> Short consistent hash values for react-intl id's

Latest version **2.0.0** (published 2018-10-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-react-intl-id-hash
pnpm add babel-plugin-react-intl-id-hash
yarn add babel-plugin-react-intl-id-hash
bun add babel-plugin-react-intl-id-hash
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-10-09 |
| First published | 2017-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 12.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | adam-26 |
| Maintainers | adam-26 |
| Keywords | react-intl, id, hash |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-react-intl-id-hash
- Repository: https://github.com/adam-26/babel-plugin-react-intl-id-hash
- Homepage: https://github.com/adam-26/babel-plugin-react-intl-id-hash#readme
- Issues: https://github.com/adam-26/babel-plugin-react-intl-id-hash/issues
- npm.io page: https://npm.io/package/babel-plugin-react-intl-id-hash

## Dependencies (2)

- [babel-types](https://npm.io/package/babel-types.md) ^6.26.0
- [murmurhash-js](https://npm.io/package/murmurhash-js.md) ^1.0.0

## Recent versions

- 2.0.0 (latest) — 2018-10-09
- 1.1.5 — 2017-11-06
- 1.1.4 — 2017-10-23
- 1.1.3 — 2017-10-23

## README

# babel-plugin-react-intl-id-hash

> react-intl `id` values as short consistent hash values, reduce translation file size!

This babel-plugin uses the murmur3 hash to generate short consistent message `id` values.

```json

```

### Before

```js
import { defineMessages } from 'react-intl'

export default defineMessages({
  hello: {
    id: 'App.Components.Greeting.hello',
    defaultMessage: 'hello {name}'
  }
})
```

### After

With babel-plugin-react-intl-id-hash.

```js
import { defineMessages } from 'react-intl'

export default defineMessages({
  hello: {
    id: 'GSplhw==',
    defaultMessage: 'hello {name}'
  }
})
```

## Install

npm

```
$ npm install --save-dev babel-plugin-react-intl-id-hash
```

yarn

```
$ yarn add --dev babel-plugin-react-intl-id-hash
```

## Usage

.babelrc

```json
{
  "plugins": [
    "react-intl-id-hash"
  ]
}
```

This can be used with the [babel-plugin-react-intl](https://github.com/yahoo/babel-plugin-react-intl).

Another good alternative is [babel-plugin-react-intl-auto](https://github.com/akameco/babel-plugin-react-intl-auto), which **must run before** this plugin.

.bablerc

```json
{
  "plugins": [
    ["react-intl-auto", {
      "removePrefix": true,
      "includeExportName": true
    }],
    "react-intl-id-hash"
  ]
}
```

### Options

#### idHash

The name of the hash to be used for generating id values

Type: `string` <br>
Default: `murmur3`

> currently, only `murmur3` is supported

## License

MIT

---
_Source: https://npm.io/package/babel-plugin-react-intl-id-hash · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
