Socket
Book a DemoInstallSign in
Socket

speed-measure-vite-plugin

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

speed-measure-vite-plugin

Measures your vite plugin transform speed

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
18K
-7.42%
Maintainers
1
Weekly downloads
 
Created
Source

speed-measure-vite-plugin

NPM NPM License Bundlephobia TypeScript

Measures your vite plugins transform speed. Support vite >= v3.

snapshot

Usage

// vite.config.js
import smvp from 'speed-measure-vite-plugin'

export default defineConfig({
  plugins: smvp([vue()]), // smvp(plugins, opts)
})

Options

smvp(plugins, {
  // Hooks to measure, defaults to ['transform']
  hooks: ['transform', 'resolveId', 'load'],

  // Sort function for output display, defaults to undefined
  // Example: sort by time in descending order
  sort: (a, b) => b - a,

  // Maximum gap time to consider hook process complete (in ms)
  // Used to detect when a hook batch is finished in dev mode
  maxGapTimeOnce: 1000,

  // maxTransformTimeOnce is deprecated, use maxGapTimeOnce instead
})

How it works

This plugin wraps your Vite plugins and measures the execution time of specified hooks. Since Vite doesn't provide direct access to lifecycle hooks for pages or the completion of hot updates in development mode, an approximate indication of the hook process completion is determined using a gap-based approach.

Keywords

vite speed

FAQs

Package last updated on 07 Aug 2025

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