# gulp-html-rename

> Shorten all ids and classes inside html, css and JavaScript.

Latest version **1.3.0** (published 2018-04-05) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install gulp-html-rename
pnpm add gulp-html-rename
yarn add gulp-html-rename
bun add gulp-html-rename
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2018-04-05 |
| First published | 2015-11-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 19.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kristof Jannes |
| Maintainers | kristof11 |
| Keywords | gulpplugin |

## Links

- npm: https://www.npmjs.com/package/gulp-html-rename
- Repository: https://github.com/Kristof11/gulp-html-rename
- Homepage: https://github.com/Kristof11/gulp-html-rename#readme
- Issues: https://github.com/Kristof11/gulp-html-rename/issues
- npm.io page: https://npm.io/package/gulp-html-rename

## Dependencies (2)

- [through2](https://npm.io/package/through2.md) 2.0.3
- [plugin-error](https://npm.io/package/plugin-error.md) 1.0.1

## Recent versions

- 1.3.0 (latest) — 2018-04-05
- 0.1.0 (beta) — 2015-11-09
- 1.2.0 — 2017-06-29

## README

# gulp-html-rename [![NPM](https://nodei.co/npm/gulp-html-rename.png)](https://nodei.co/npm/gulp-html-rename/)
> An HTML, CSS and JavaScript id and class minimiser.

This plugin only renames ids with a prefix of `id-` and classes with a prefix of `class-`.
You can specify more prefixes though the options object.

[Polymer](https://github.com/polymer/polymer) element names are included by default (`iron-`, `paper-`, ...)

## Usage

First, install `gulp-html-rename` as a development dependency:

```shell
npm install --save-dev gulp-html-rename
```

Then, add it to your `gulpfile.js`:

### Default Rename
```javascript
const gulpHTMLRename = require('gulp-html-rename');

gulp.task('rename', function(){
  gulp.src(['build/**/*'])
    .pipe(gulpHTMLRename())
    .pipe(gulp.dest('build/'));
});
```
### Custom Replace
```javascript
const gulpHTMLRename = require('gulp-html-rename');
const options = [
  'my-id-'
];

gulp.task('rename', function(){
  gulp.src(['build/**/*'])
    .pipe(gulpHTMLRename(options))
    .pipe(gulp.dest('build/'));
});
```
### Custom File extensions

> html, css and js are included by default

```javascript
const gulpHTMLRename = require('gulp-html-rename');

gulp.task('rename', function(){
  gulp.src(['build/**/*'])
    .pipe(htmlRename([], ['ts']))
    .pipe(gulp.dest('build/'));
});
```


## API

gulp-html-rename can be called with options.

### gulpHTMLRename(options, allowedExtensions)

#### options
Type: `Array`

The array with prefix strings.

### allowedExtensions
Type: `Array`

The array with file extensions.

[npm-url]: https://npmjs.org/package/gulp-html-rename

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