Skip to content

Commit

Permalink
feat:Added default value for include option (#47)
Browse files Browse the repository at this point in the history
* Added default value for `include` option

* added svg to default `include`
  • Loading branch information
Ibadichan authored Apr 18, 2024
1 parent 5a16590 commit f47dcdb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default defineConfig({

| params | type | default | description |
| ---------------------- | --------------------------------------------- | ----------------- | -------------------------------------------------------------- |
| `include` | `string \| RegExp \| Array<string \| RegExp>` | `-` | Include all assets matching any of these conditions. |
| `include` | `string \| RegExp \| Array<string \| RegExp>` | `/\.(html|xml|css|json|js|mjs|svg)$/` | Include all assets matching any of these conditions. |
| `exclude` | `string \| RegExp \| Array<string \| RegExp>` | `-` | Exclude all assets matching any of these conditions. |
| `threshold` | `number` | `0` | Only assets bigger than this size are processed (in bytes) |
| `algorithm` | `string\| function` | `gzip` | The compression algorithm |
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function compression<T extends UserCompressionOptions = NonNullable<unknown>>(op
function compression(opts: ViteWithoutCompressionPluginConfigFunction): Plugin
function compression<T extends UserCompressionOptions, A extends Algorithm>(opts: ViteCompressionPluginConfig<T, A> = {}): Plugin {
const {
include,
include = /\.(html|xml|css|json|js|mjs|svg)$/,
exclude,
threshold = 0,
algorithm: userAlgorithm = 'gzip',
Expand Down

0 comments on commit f47dcdb

Please sign in to comment.