Skip to content

ZSTD? #61

Answered by nonzzz
beckend asked this question in Q&A
Jul 22, 2024 · 9 comments · 1 reply
Discussion options

You must be logged in to vote

Here is a simple example for zstd usage.

  • setup option for compression plugin.
import { compress } from '@mongodb-js/zstd'
import { compression } from 'vite-plugin-compression2'

defineConfig({
  plugins: [
  // .... your vite's plugins
    compression < { level: number } > ({
      algorithm(buf, opt) {
        return compress(buf as any, opt)
      },
      compressionOptions: {
        level: 9
      },
      filename: '[path][base].zst'
    })
  ]
})

then run vite build

Replies: 9 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jclaveau
Comment options

Answer selected by nonzzz
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
good first issue Good for newcomers
4 participants
Converted from issue

This discussion was converted from issue #60 on August 05, 2024 13:12.