PostHTML Plugin Remove Duplicates
This plugin removes duplicated tags. It can be used to remove duplicated css and script tags when your markup is assembling code from different sources.
Before:
... component...... component...
After:
... component...... component...
Install
npm i posthtml posthtml-plugin-remove-duplicates
Usage
const fs = ;const posthtml = ;const posthtmlPluginRemoveDuplicates = ;;
Options
- css: remove duplicated css tags (default false)
- js: remove duplicated script tags (default false)
- custom: object or array of objects, with tag (optional) and attribute (mandatory)
{ tag: 'div', attr: 'data-remove-dup' }