README
PostCSS Deduplicate
PostCSS plugin to remove duplicate class definitions. Based on Kristofer Joseph's rework-deduplicate plugin.
Install
npm i --save
Usage
var dedupe = require('postcss-deduplicate');
var read = require('fs').readFileSync;
var css = postcss([dedupe('')])
.process(read('path/to/source.css', 'utf8'))
.then(result => { console.log(result.css.toString()) });
Example
Input:
.button {
background: black;
}
.button {
background: red;
}
.button {
background: black;
}
Output:
.button {
background: black;
}
.button {
background: red;
}