PostCSS plugin to remove duplicate class definitions
npm install postcss-deduplicate      
---
title="Philosopher’s stone, logo of PostCSS"
src="http://postcss.github.io/postcss/logo.svg">
PostCSS plugin to remove duplicate class definitions. Based on Kristofer Joseph's rework-deduplicate plugin.
npm i --save
``js
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()) });
`
Input:
`css`
.button {
background: black;
}
.button {
background: red;
}
.button {
background: black;
}
Output:
`css``
.button {
background: black;
}
.button {
background: red;
}