Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/XeryYue/vite-compression-plugin

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/XeryYue/vite-compression-plugin

  • v1.3.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

codecov

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

paramstypedefaultdescription
includestring | RegExp | Array<string | RegExp>/\.(html|xml|css|json|js|mjs|svg|yaml|yml|toml)$/Include all assets matching any of these conditions.
excludestring | RegExp | Array<string | RegExp>-Exclude all assets matching any of these conditions.
thresholdnumber0Only assets bigger than this size are processed (in bytes)
algorithmstring| functiongzipThe compression algorithm
compressionOptionsRecord<string,any>{}Compression options for algorithm(details see zlib module)
deleteOriginalAssetsbooleanfalseWhether to delete the original assets or not
skipIfLargerOrEqualbooleantrueWhether to skip the compression if the result is larger than or equal to the original file
filenamestring[path][base].gzThe target asset filename

Q & A

FAQ

Others

  • If you want to analysis your bundle assets. Maybe you can try vite-bundle-analyzer

  • tarball option dest means to generate a tarball somewhere

  • tarball is based on the ustar. It should be compatible with all popular tar distributions out there (gnutar, bsdtar etc)

Sponsors

LICENSE

MIT

Author

Kanno

FAQs

Package last updated on 08 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc