gulp-remove-duplicate-reference

1.0.8 • Public • Published

Used to remove duplicate references in html.

Usage

  var gulp = require("gulp"),
      removeDuplicateReference = require("gulp-remove-duplicate-reference");
    
  /**
   * Use "strict" compare mode, which means all the tag attributes
   * should be the same
   */
  gulp.src("*.html").pipe(removeDuplicateReference());
  gulp.src("*.html").pipe(removeDuplicateReference({compareMethod: "strict"}));
  
  /**
   * Use "kind" compare mode, which means the referring file path
   * should be the same
   */
  gulp.src("*.html").pipe(removeDuplicateReference({compareMethod: "kind"}));

Options

compareMethod

Specifies how to judge if two reference is the same.

strict (default): Compares references with all the declared html attributes. Treat as different reference if at least one attribute is different, which means no reference will be removed.

kind: Compares references with resource path only.

Note

Supported reference

link, script

License

MIT

Package Sidebar

Install

npm i gulp-remove-duplicate-reference

Weekly Downloads

4

Version

1.0.8

License

MIT

Unpacked Size

31.7 kB

Total Files

6

Last publish

Collaborators

  • hotteapot