gulp-remove-duplicate-reference
v1.0.8
Published
Used to remove duplicate references in html.
Downloads
39
Maintainers
Readme
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