Compress your bundle + assets from Vite
./public
are compressed with Brotliexclude: ["ssr-manifest.json"]
import compress from 'vite-plugin-compress'
export default {
plugins: [
compress(),
]
}
quality: number
Higher quality means smaller file sizes.
Defaults to max quality (11).
threshold: number
Minimum file size (in bytes) to be compressed.
Defaults to 1501.
exclude: string[]
Globs to exclude certain files from being compressed.
extensions: string[]
Additional extensions to compress with Brotli.
Default extensions include:
.html
.js
.css
.svg
.json
svgo: object
Options for the SVG optimizer.
More info here.
Default plugins include:
removeViewBox: false
removeDimensions: true
pngquant: object
Options for the PNG optimizer.
More info here.
brotli: boolean
Set to false to disable Brotli compression.
verbose: boolean
Log compressed files and their compression ratios.