This package has been deprecated

Author message:

Package no longer maintained

gulp-html-rename

1.3.0 • Public • Published

gulp-html-rename NPM

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 element names are included by default (iron-, paper-, ...)

Usage

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

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

Then, add it to your gulpfile.js:

Default Rename

const gulpHTMLRename = require('gulp-html-rename');
 
gulp.task('rename', function(){
  gulp.src(['build/**/*'])
    .pipe(gulpHTMLRename())
    .pipe(gulp.dest('build/'));
});

Custom Replace

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

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.

Readme

Keywords

Package Sidebar

Install

npm i gulp-html-rename

Weekly Downloads

25

Version

1.3.0

License

MIT

Unpacked Size

19.7 kB

Total Files

10

Last publish

Collaborators

  • kristof11