unplugin-time-stat is a utility that provides unified build time stat reporting across various JavaScript bundlers, including Vite, Webpack, Rspack, Rollup, and esbuild, by leveraging the `unplugin` ecosystem. It addresses the common challenge of inconsistent build performance reporting mechanisms across different build tools, offering a single interface to monitor and report build durations. The current stable version is `0.3.0`. The project has seen regular, feature-driven releases, indicating active development. A key differentiator is its ability to integrate custom hooks, allowing developers to programmatically capture build metrics and integrate them with external services or custom reporting tools, beyond just console output. This makes it a versatile tool for performance monitoring in diverse build environments.
npm install unplugin-time-statVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to integrate unplugin-time-stat into a Vite project with a custom hook to process build time metrics.
Ensure you are importing `unplugin-time-stat/<your-bundler>` (e.g., `/vite`, `/rollup`, `/esbuild`, `/webpack`, `/nuxt`) as per your project's build tool.
Install the appropriate peer dependency for your bundler, e.g., `npm install vite` or `npm install webpack`.
Refer to the official GitHub repository's release notes for each new version to understand any API changes or new features.
Verify the package is installed (`npm install unplugin-time-stat`) and that the import path matches your bundler (e.g., `unplugin-time-stat/vite`, `unplugin-time-stat/webpack`).
Ensure you are using the correct import syntax for your environment: `import TimeStat from '...'` for ESM, and `const TimeStat = require('...')` for CommonJS, especially for Webpack/Rspack integrations.