Skip to content

Commit

Permalink
refactor: next
Browse files Browse the repository at this point in the history
BREAKING CHANGE: minimum supported webpack version is `^5.1.0`
  • Loading branch information
cap-Bernardito authored Dec 2, 2020
1 parent 4a10f07 commit 1c37b2f
Show file tree
Hide file tree
Showing 51 changed files with 1,111 additions and 7,728 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [10.x, 12.x, 14.x]
webpack-version: [4, latest]
webpack-version: [latest]

runs-on: ${{ matrix.os }}

Expand Down
43 changes: 0 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ And run `webpack` via your preferred method.
| **[`minRatio`](#minratio)** | `{Number}` | `0.8` | Only assets that compress better than this ratio are processed (`minRatio = Compressed Size / Original Size`) |
| **[`filename`](#filename)** | `{String\|Function}` | `[path][base].gz` | The target asset filename |
| **[`deleteOriginalAssets`](#deleteoriginalassets)** | `{Boolean\|'keep-source-map'}` | `false` | Whether to delete the original assets or not |
| **[`cache`](#cache)** | `{Boolean}` | `true` | Enable file caching |

### `test`

Expand Down Expand Up @@ -319,48 +318,6 @@ module.exports = {
};
```

### `cache`

> ⚠ Ignored in webpack 5! Please use https://webpack.js.org/configuration/other-options/#cache.
Type: `Boolean|String`
Default: `true`

Enable file caching.
The default path to cache directory: `node_modules/.cache/compression-webpack-plugin`.

#### `Boolean`

Enable/disable file caching.

**webpack.config.js**

```js
module.exports = {
plugins: [
new CompressionPlugin({
cache: true,
}),
],
};
```

#### `String`

Enable file caching and set path to cache directory.

**webpack.config.js**

```js
module.exports = {
plugins: [
new CompressionPlugin({
cache: "path/to/cache",
}),
],
};
```

## Examples

### Using Zopfli
Expand Down
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
module.exports = {
testEnvironment: "node",
snapshotResolver: "./test/helpers/snapshotResolver.js",
};
Loading

0 comments on commit 1c37b2f

Please sign in to comment.