{"id":22884,"library":"vite-plugin-time-reporter","title":"vite-plugin-time-reporter","description":"A Vite plugin that reports build and dev server startup times. Current version 2.3.0 supports Vite 2,3,4,5 and is ESM+CJS dual-package (ESM-only since v2.2.0). Ships TypeScript types, requires Node >=18. Reports elapsed time for each plugin and total build time in a clean console output. Minimal configuration, no external dependencies beyond Vite as a peer dependency.","status":"active","version":"2.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/Shinigami92/vite-plugin-time-reporter","tags":["javascript","vite","vite-plugin","time","reporting","report","plugin","vitejs","awesome","typescript"],"install":[{"cmd":"npm install vite-plugin-time-reporter","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-time-reporter","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-time-reporter","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to function as a Vite plugin","package":"vite","optional":false}],"imports":[{"note":"Package is ESM-only since v2.2.0; require() fails in CJS context. Use dynamic import() if needed.","wrong":"const timeReporter = require('vite-plugin-time-reporter')","symbol":"default","correct":"import timeReporter from 'vite-plugin-time-reporter'"},{"note":"Package also exports a named export `timeReporter` (identical to default). Both work, but default import is more common.","wrong":"import timeReporter from 'vite-plugin-time-reporter'","symbol":"timeReporter (named)","correct":"import { timeReporter } from 'vite-plugin-time-reporter'"},{"note":"Options type is exported; use `import type` for type-only imports to avoid runtime side effects.","wrong":"import { TimeReporterOptions } from 'vite-plugin-time-reporter'","symbol":"timeReporter (type)","correct":"import type { TimeReporterOptions } from 'vite-plugin-time-reporter'"}],"quickstart":{"code":"import vue from '@vitejs/plugin-vue';\nimport { defineConfig } from 'vite';\nimport timeReporter from 'vite-plugin-time-reporter';\n\nexport default defineConfig({\n  plugins: [\n    vue(),\n    timeReporter()\n  ]\n});","lang":"typescript","description":"Adds the time reporter plugin to a Vite config, showing build and dev server time in console."},"warnings":[{"fix":"Use ESM imports (import) or dynamic import if in a CJS context.","message":"v2.2.0 dropped CommonJS support; require() throws ERR_REQUIRE_ESM.","severity":"breaking","affected_versions":">=2.2.0"},{"fix":"Ensure your bundler supports the package.json `exports` field, or upgrade to v2.2.0+ (ESM-only).","message":"v2.0.0 switched to dual ESM/CJS package; may break bundlers that don't support `exports` field.","severity":"breaking","affected_versions":">=2.0.0 <2.2.0"},{"fix":"Check Vite's `--logLevel` option; the plugin respects Vite's logger verbosity.","message":"The plugin reports times for subsequent builds (HMR) but may not show all plugin times correctly in watch mode.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `npm install --save-dev` (or equivalent).","message":"Installing as devDependency is mandatory; production builds will error if listed in dependencies.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Change to `import timeReporter from 'vite-plugin-time-reporter'` or use dynamic import.","cause":"Using require() on v2.2.0+ which is ESM-only.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported"},{"fix":"Install as dev dependency: `npm install --save-dev vite-plugin-time-reporter`. For older bundlers, upgrade to v2.2.0+.","cause":"Package not installed or not resolved due to missing exports field support.","error":"Cannot find module 'vite-plugin-time-reporter'"},{"fix":"Use default import: `import timeReporter from 'vite-plugin-time-reporter'`. Or upgrade to v2.0.0+.","cause":"Trying to import named export 'timeReporter' from a version that only has default export (pre-v2.0.0).","error":"export 'timeReporter' (imported as 'timeReporter') was not found in 'vite-plugin-time-reporter'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}