An open API service indexing awesome lists of open source software.

https://github.com/markis/dedupe-string-plugin

Deduplicate strings from javascript files
https://github.com/markis/dedupe-string-plugin

Last synced: 7 months ago
JSON representation

Deduplicate strings from javascript files

Awesome Lists containing this project

README

          

# dedupe-string-plugin

[![Build Status](https://travis-ci.org/markis/dedupe-string-plugin.svg?branch=master)](https://travis-ci.org/markis/dedupe-string-plugin) [![Known Vulnerabilities](https://snyk.io/test/github/markis/dedupe-string-plugin/badge.svg)](https://snyk.io/test/github/markis/dedupe-string-plugin) [![Greenkeeper badge](https://badges.greenkeeper.io/markis/dedupe-string-plugin.svg)](https://greenkeeper.io/)

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:
``` javascript
function thing() {
React.createElement('div');
// ... somewhere outside of the gzip sliding window (32KB)
React.createElement('div');
}
```

##### After dedupe-string-plugin:
``` javascript
function thing() {
const e = 'div';
React.createElement(e);
// ... somewhere outside of the gzip sliding window (32KB
React.createElement(e);
}
```

##### Webpack usage

``` javascript
var DedupeString = require('dedupe-string-plugin');

module.exports = {
plugins: [
new DedupeString()
]
};
```