vite-plugin-time-reporter
raw JSON → 2.3.2 verified Mon Apr 27 auth: no javascript
A Vite plugin that reports build and dev server startup times. Version 2.3.2 supports Vite 2, 3, 4, 5, and 7 (via a forked package). Provides a simple, configurable time log for each Vite run, displaying formatted durations for key phases like resolving plugins, loading config, and building. Unlike manual console.time calls or full-featured profiling tools, this plugin is lightweight, zero-config, and integrates directly into the Vite plugin lifecycle. Published on npm with two packages: `vite-plugin-time-reporter` for Vite ≤5 and `vite-plugin-time-reporter-vite7` for Vite 7. Ships TypeScript declarations and is actively maintained (2025).
Common errors
error Cannot find module 'vite-plugin-time-reporter' or its corresponding type declarations. ↓
cause Missing devDependency or using wrong package name for Vite 7.
fix
Run
npm install --save-dev vite-plugin-time-reporter-vite7 for Vite 7, or the correct package for your Vite version. error TypeError: timeReporter is not a function ↓
cause CommonJS require without .default.
fix
Use
const timeReporter = require('vite-plugin-time-reporter').default (or switch to ESM import). error The plugin 'vite:time-reporter' collides with another plugin with the same name. ↓
cause Multiple instances of timeReporter added to plugins array.
fix
Ensure timeReporter() is called only once in the plugins array.
Warnings
breaking Package split into two npm packages for Vite 7 compatibility. vite-plugin-time-reporter (v2.x) does not work with Vite 7; use vite-plugin-time-reporter-vite7 for Vite 7. ↓
fix Install vite-plugin-time-reporter-vite7 instead of vite-plugin-time-reporter when using Vite 7.
breaking Removed options argument; timeReporter() now accepts no parameters. ↓
fix Remove any arguments passed to timeReporter(). Previously configurable options are now automatically set.
gotcha Plugin must be placed after other transform plugins (e.g., vue) in the plugins array to capture accurate timing. ↓
fix Add timeReporter() last in the plugins array, or at least after plugins that transform code.
deprecated The package name 'vite-plugin-time-reporter-vite7' is considered a fork and may not receive updates alongside the main package. ↓
fix Monitor the GitHub repository for future consolidation.
Install
npm install vite-plugin-time-reporter-vite7 yarn add vite-plugin-time-reporter-vite7 pnpm add vite-plugin-time-reporter-vite7 Imports
- timeReporter
import timeReporter from 'vite-plugin-time-reporter' - TimeReporterOptions
import type { TimeReporterOptions } from 'vite-plugin-time-reporter' - timeReporter wrong
const timeReporter = require('vite-plugin-time-reporter')correctconst timeReporter = require('vite-plugin-time-reporter').default
Quickstart
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import timeReporter from 'vite-plugin-time-reporter';
export default defineConfig({
plugins: [vue(), timeReporter()],
});