1.3.0 • Published 9 months ago
vite-plugin-compression2 v1.3.0
Install
$ yarn add vite-plugin-compression2 -D
# or
$ npm install vite-plugin-compression2 -D
Usage
import { defineConfig } from 'vite'
import { compression } from 'vite-plugin-compression2'
export default defineConfig({
plugins: [
// ...your plugin
compression()
// If you want to create a tarball archive you can import tarball plugin from this package and use
// after compression.
]
})
Options
params | type | default | description |
---|---|---|---|
include | string \| RegExp \| Array<string \| RegExp> | /\.(html\|xml\|css\|json\|js\|mjs\|svg\|yaml\|yml\|toml)$/ | 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 |
compressionOptions | Record<string,any> | {} | Compression options for algorithm (details see zlib module ) |
deleteOriginalAssets | boolean | false | Whether to delete the original assets or not |
skipIfLargerOrEqual | boolean | true | Whether to skip the compression if the result is larger than or equal to the original file |
filename | string | [path][base].gz | The target asset filename |
Q & A
Others
If you want to analysis your bundle assets. Maybe you can try vite-bundle-analyzer
tarball
optiondest
means to generate a tarball somewheretarball
is based on theustar
. It should be compatible with all popular tar distributions out there (gnutar, bsdtar etc)
Sponsors
LICENSE
Author
Kanno
1.3.0
9 months ago
1.2.0
10 months ago
1.1.1
1 year ago
1.1.4
10 months ago
1.1.3
11 months ago
1.1.2
12 months ago
1.1.0
1 year ago
1.0.0
1 year ago
0.12.0
1 year ago
0.11.0
2 years ago
0.10.6
2 years ago
0.9.3
2 years ago
0.10.1
2 years ago
0.10.2
2 years ago
0.10.3
2 years ago
0.10.4
2 years ago
0.10.5
2 years ago
0.10.0
2 years ago
0.9.2
2 years ago
0.8.4
2 years ago
0.9.0
2 years ago
0.8.1
2 years ago
0.6.3
2 years ago
0.8.0
2 years ago
0.6.2
2 years ago
0.8.3
2 years ago
0.9.1
2 years ago
0.8.2
2 years ago
0.7.0
2 years ago
0.6.1
2 years ago
0.6.0
2 years ago
0.5.0
2 years ago
0.4.3
2 years ago
0.4.2
2 years ago
0.4.1
3 years ago
0.4.0
3 years ago
0.3.0
3 years ago
0.2.0
3 years ago
0.1.0
3 years ago