grunt-remove-duplicates
Removes scripts duplicates from HTML files
Getting Started
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-remove-duplicates --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
The "remove_duplicates" task
Overview
Plugin remove "script" and "link" tags with duplicate "src" and "href" attributes
will become
In your project's Gruntfile, add a section named remove_duplicates
to the data object passed into grunt.initConfig()
.
grunt;
Options
options.keepLast
Type: String
Default value: false
This option controls the placement of the remaining script. If this option is set to false then first entry of the script will remain otherwise the last entry will be left
Usage Examples
Default Options
In this example, the default options are used to remove duplications from file.
grunt;
Multiple files and keep last entry
grunt;
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Release History
- 2014-11-05 v0.1.1 Styles duplicates removing
- 2014-10-25 v0.1.0 Initial upload