Skip to content

Commit c84aaf4

Browse files
authored
chore: Updated readme doc brotliCompress example (#49)
1 parent f47dcdb commit c84aaf4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default defineConfig({
3535

3636
| params | type | default | description |
3737
| ---------------------- | --------------------------------------------- | ----------------- | -------------------------------------------------------------- |
38-
| `include` | `string \| RegExp \| Array<string \| RegExp>` | `/\.(html|xml|css|json|js|mjs|svg)$/` | Include all assets matching any of these conditions. |
38+
| `include` | `string \| RegExp \| Array<string \| RegExp>` | `/\.(html\|xml\|css\|json\|js\|mjs\|svg)$/` | Include all assets matching any of these conditions. |
3939
| `exclude` | `string \| RegExp \| Array<string \| RegExp>` | `-` | Exclude all assets matching any of these conditions. |
4040
| `threshold` | `number` | `0` | Only assets bigger than this size are processed (in bytes) |
4141
| `algorithm` | `string\| function` | `gzip` | The compression algorithm |
@@ -68,15 +68,11 @@ export default defineComponent({
6868
plugins: [
6969
// ...your plugin
7070
compression(),
71-
compression({ algorithm: 'brotliCompress', exclude: [/\.(br)$/, /\.(gz)$/], deleteOriginalAssets: true })
71+
compression({ algorithm: 'brotliCompress' })
7272
]
7373
})
7474
```
7575

76-
- You should set `exclude` for the latest compression plugin. ( Because in the full bundle process. Bundle chunk is shared. And
77-
there are write (delete) operations on the bundle inside the plugin. So you should ignore the compressed chunk :) If you want delete
78-
the original assets you also follow the way.
79-
8076
> Can i create a tarball for all of assets after compressed?
8177
- Yes, you can import `tarball` plugin from this package(>=1.0.0)
8278
```js

0 commit comments

Comments
 (0)