All Projects → alloc → vite-plugin-compress

alloc / vite-plugin-compress

Licence: MIT license
Compress your bundle + assets from Vite

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to vite-plugin-compress

vite-plugin-md
Markdown with Vue for Vite
Stars: ✭ 289 (+180.58%)
Mutual labels:  vite, vite-plugin
vite-plugin-dts
A vite plugin for generating `.d.ts` files.
Stars: ✭ 539 (+423.3%)
Mutual labels:  vite, vite-plugin
vite-plugin-env-compatible
Environment Variables Compatible for vite(with vue-cli, create-react-app and so on)
Stars: ✭ 35 (-66.02%)
Mutual labels:  vite, vite-plugin
vite-plugin-inspect
Inspect the intermediate state of Vite plugins
Stars: ✭ 491 (+376.7%)
Mutual labels:  vite, vite-plugin
vite-plugin-banner
A banner plugin for Vite. It can adds a banner to the top of each generated chunk.
Stars: ✭ 39 (-62.14%)
Mutual labels:  vite, vite-plugin
vite-plugin-relay
A vite plugin for Relay
Stars: ✭ 44 (-57.28%)
Mutual labels:  vite, vite-plugin
vite-plugin-restart
Custom files/globs to restart Vite server
Stars: ✭ 92 (-10.68%)
Mutual labels:  vite, vite-plugin
vite-plugin-checker
💬 Vite plugin that provide checks of TypeScript, ESLint, vue-tsc, and more.
Stars: ✭ 338 (+228.16%)
Mutual labels:  vite, vite-plugin
vite-plugin-ssr
Like Next.js / Nuxt but as do-one-thing-do-it-well Vite plugin.
Stars: ✭ 1,703 (+1553.4%)
Mutual labels:  vite, vite-plugin
vite-plugins
🌱 为社区尽一份绵薄之力
Stars: ✭ 63 (-38.83%)
Mutual labels:  vite, vite-plugin
vite-plugin-html-template
html template for vite, like html-webpack-plugin for webpack.
Stars: ✭ 97 (-5.83%)
Mutual labels:  vite, vite-plugin
vite-plugin-sleep
a vite plugin you never need. slow devServer and slow HMR.
Stars: ✭ 77 (-25.24%)
Mutual labels:  vite, vite-plugin
vite-plugin-radar
All in one analytics loader for vite
Stars: ✭ 64 (-37.86%)
Mutual labels:  vite, vite-plugin
vite-plugin-webfont-dl
⚡ Webfont Download Vite Plugin - Make your Vite site load faster
Stars: ✭ 69 (-33.01%)
Mutual labels:  vite, vite-plugin
vite-plugin-environment
Easily expose environment variables in Vite.js
Stars: ✭ 57 (-44.66%)
Mutual labels:  vite, vite-plugin
codeigniter-vue-boilerplate
CodeIgniter 3 + Vue.js 3 + Vite with supported Hot Module Replacement (HMR)
Stars: ✭ 38 (-63.11%)
Mutual labels:  vite
create-xc-app
⚡️ Create a project in seconds!
Stars: ✭ 15 (-85.44%)
Mutual labels:  vite
vue3-element-admin
🎉 基于 vite2 + vue3 + element-plus 的后台管理系统vue3-element-admin;使用vue-cli可以切换webpack分支
Stars: ✭ 79 (-23.3%)
Mutual labels:  vite
geoxor.moe
This is my homepage website where people can download my music, covers and other assets!
Stars: ✭ 22 (-78.64%)
Mutual labels:  vite
vite-plugin-image-presets
🖼 Image Presets for Vite.js apps
Stars: ✭ 164 (+59.22%)
Mutual labels:  vite-plugin

vite-plugin-compress

npm Code style: Prettier Donate

Compress your bundle + assets from Vite

  • Assets generated by Vite and assets from ./public are compressed with Brotli
  • Images, sounds, WOFF2 fonts, and PDFs are not compressed with Brotli, since these formats are compressed by default
  • SVGs are further optimized with svgo
  • PNGs are further optimized with imagemin
  • By default, files smaller than 1501 bytes are not compressed, since the MTU of a TCP packet is 1500 bytes
  • Compatible with vite-ssr
    • Just add exclude: ["ssr-manifest.json"]

 

Usage

import compress from 'vite-plugin-compress'

export default {
  plugins: [
    compress(),
  ]
}

Options

  • 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
    • Plugins listed here are enabled
  • 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].