Skip to content

Commit 778e866

Browse files
refactor: code
BREAKING CHANGE: the `cache` option is ignored in webpack 5. Please use https://webpack.js.org/configuration/other-options/#cache.
1 parent cff32d7 commit 778e866

21 files changed

+2223
-1011
lines changed

README.md

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -97,46 +97,6 @@ module.exports = {
9797
};
9898
```
9999

100-
### `cache`
101-
102-
Type: `Boolean|String`
103-
Default: `false`
104-
105-
Enable file caching.
106-
The default path to cache directory: `node_modules/.cache/compression-webpack-plugin`.
107-
108-
#### `Boolean`
109-
110-
Enable/disable file caching.
111-
112-
**webpack.config.js**
113-
114-
```js
115-
module.exports = {
116-
plugins: [
117-
new CompressionPlugin({
118-
cache: true,
119-
}),
120-
],
121-
};
122-
```
123-
124-
#### `String`
125-
126-
Enable file caching and set path to cache directory.
127-
128-
**webpack.config.js**
129-
130-
```js
131-
module.exports = {
132-
plugins: [
133-
new CompressionPlugin({
134-
cache: 'path/to/cache',
135-
}),
136-
],
137-
};
138-
```
139-
140100
### `filename`
141101

142102
Type: `String|Function`
@@ -307,6 +267,48 @@ module.exports = {
307267
};
308268
```
309269

270+
### `cache`
271+
272+
> ⚠ Ignored in webpack 5! Please use https://webpack.js.org/configuration/other-options/#cache.
273+
274+
Type: `Boolean|String`
275+
Default: `false`
276+
277+
Enable file caching.
278+
The default path to cache directory: `node_modules/.cache/compression-webpack-plugin`.
279+
280+
#### `Boolean`
281+
282+
Enable/disable file caching.
283+
284+
**webpack.config.js**
285+
286+
```js
287+
module.exports = {
288+
plugins: [
289+
new CompressionPlugin({
290+
cache: true,
291+
}),
292+
],
293+
};
294+
```
295+
296+
#### `String`
297+
298+
Enable file caching and set path to cache directory.
299+
300+
**webpack.config.js**
301+
302+
```js
303+
module.exports = {
304+
plugins: [
305+
new CompressionPlugin({
306+
cache: 'path/to/cache',
307+
}),
308+
],
309+
};
310+
```
311+
310312
## Examples
311313

312314
### Using Zopfli

0 commit comments

Comments
 (0)