fix: disable brotli compression in preview server

x-ref: https://github.com/faker-js/faker/pull/3755

Local tests suggest that `zlib.createBrotliCompress` is around 50x slower than `zlib.createGzip`. Although brotli produces 25% smaller for the test subject, such low speed is not desirable for `vitepress preview` as the command is meant for local servers.

This aligns the preview compression with vite.
pull/5151/head
Divyansh Singh 2 months ago committed by GitHub
parent 5ad39ab934
commit ca1e875129
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -37,7 +37,7 @@ export async function serve(options: ServeOptions = {}) {
res.end()
}
const compress = compression({ brotli: true })
const compress = compression()
const serve = sirv(config.outDir, {
etag: true,
maxAge: 31536000,

Loading…
Cancel
Save