dedupe-string-plugin
Dedupe-String-Plugin is a plugin for webpack that is optimized to work with gzip and remove duplicate strings that the gzip compression algorithm is not going to be able to dedupe.
Before dedupe-string-plugin:
function thing() {
React.createElement('div');
React.createElement('div');
}
After dedupe-string-plugin:
function thing() {
const e = 'div';
React.createElement(e);
React.createElement(e);
}
Webpack usage
var DedupeString = require('dedupe-string-plugin');
module.exports = {
plugins: [
new DedupeString()
]
};