Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.3 KB

README.md

File metadata and controls

43 lines (30 loc) · 1.3 KB

🚰 vite-plugin-rate-limiter

npm npm GitHub Workflow Status

A vite plugin to limit the speed of specific files from ViteDevServer to your browser in development mode.

Install

# npm
npm i vite-plugin-rate-limiter -D

# yarn
yarn add vite-plugin-rate-limiter -D

# pnpm
pnpm add vite-plugin-rate-limiter -D

Usage

// vite.config.ts
import { defineConfig } from 'vite'
import { ViteRateLimiter } from 'vite-plugin-rate-limiter'

export default defineConfig({
  plugins: [
    ViteRateLimiter({
      rate: 100, // 100 kb/s
      matchOpts: '**/*.glb'
    }),
  ]
})

Why?

Sometimes we need to simulate poor network environments, but damn local development server is so fast, now you can limit the speed of specific files to your browser in development mode with this plugin. 🐢

License

MIT License © 2022 Archer Gu