{"id":15020182,"url":"https://github.com/kazupon/unplugin-time-stat","last_synced_at":"2025-10-25T07:30:36.912Z","repository":{"id":206941022,"uuid":"718063550","full_name":"kazupon/unplugin-time-stat","owner":"kazupon","description":"Build time stat reporting for unplugin","archived":false,"fork":false,"pushed_at":"2025-02-09T14:49:41.000Z","size":162,"stargazers_count":13,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-09T15:34:35.723Z","etag":null,"topics":["esbuild","performance","rollup","rspack","stats","unplugin","vite","webpack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kazupon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"kazupon"}},"created_at":"2023-11-13T09:51:48.000Z","updated_at":"2024-06-18T14:46:56.000Z","dependencies_parsed_at":"2024-01-03T02:55:05.043Z","dependency_job_id":"e5da8cb7-96f6-4997-9437-b65068f742ea","html_url":"https://github.com/kazupon/unplugin-time-stat","commit_stats":{"total_commits":19,"total_committers":3,"mean_commits":6.333333333333333,"dds":"0.42105263157894735","last_synced_commit":"d6bd44c4ec85aa7a456aa9b91a05ca24fa59e07e"},"previous_names":["kazupon/unplugin-time-stat"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazupon%2Funplugin-time-stat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazupon%2Funplugin-time-stat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazupon%2Funplugin-time-stat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazupon%2Funplugin-time-stat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kazupon","download_url":"https://codeload.github.com/kazupon/unplugin-time-stat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238096257,"owners_count":19415766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esbuild","performance","rollup","rspack","stats","unplugin","vite","webpack"],"created_at":"2024-09-24T19:54:41.774Z","updated_at":"2025-10-25T07:30:36.563Z","avatar_url":"https://github.com/kazupon.png","language":"TypeScript","readme":"# unplugin-time-stat\n\n[![npm version][npm-version-src]][npm-version-href]\n[![CI][ci-src]][ci-href]\n\nBuild time stat reporting for [unplugin](https://github.com/unjs/unplugin).\n\n## 🙋 Motivations\n\n- Each bundler has a different way of getting stats build times\n  - webapck / rspack: stat json generated with the `--json` or `--analyzer` option\n  - vite / rollup: stat via 3rd party plugin\n\n## 🌟 Features\n\n### build time output console\n\n![console](assets/console.png)\n\n### custom hook\n\nYou can hook for build output time.\n\nexample for vite plugin case:\n\n```ts\nimport TimeStat from 'unplugin-time-stat/vite'\n\nfunction metrics(buildTime, { start, end }) {\n  // Something hooking (ex. send metrics service like datadog)\n  // ...\n\n  // if you will return a string, it's output to console\n  return `Build time: ${raw.end.getTime() - raw.start.getTime()}ms`\n}\n\nexport default {\n  plugins: [\n    TimeStat({\n      hook: metrics\n    })\n  ]\n}\n```\n\n## 💿 Install\n\n```sh\n# Using npm\nnpm install unplugin-time-stat\n\n# Using yarn\nyarn add unplugin-time-stat\n\n# Using pnpm\npnpm add unplugin-time-stat\n\n# Using bun\nbun add unplugin-time-stat\n```\n\n## 🚀 Usages\n\n\u003cdetails\u003e\n\u003csummary\u003eVite\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// vite.config.ts\nimport TimeStat from 'unplugin-time-stat/vite'\n\nexport default defineConfig({\n  plugins: [\n    TimeStat({\n      /* options */\n    })\n  ]\n})\n```\n\nbuild example: [`playground/`](./playground/)\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRollup\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// rollup.config.js\nimport TimeStat from 'unplugin-time-stat/rollup'\n\nexport default {\n  plugins: [\n    TimeStat({\n      /* options */\n    })\n  ]\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWebpack\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// webpack.config.js\nmodule.exports = {\n  /* ... */\n  plugins: [\n    require('unplugin-time-stat/webpack')({\n      /* options */\n    })\n  ]\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eNuxt\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// nuxt.config.js\nexport default defineNuxtConfig({\n  modules: [\n    [\n      'unplugin-time-stat/nuxt',\n      {\n        /* options */\n      }\n    ]\n  ]\n})\n```\n\n\u003e This module works for both Nuxt 2 and [Nuxt Vite](https://github.com/nuxt/vite)\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eVue CLI\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// vue.config.js\nmodule.exports = {\n  configureWebpack: {\n    plugins: [\n      require('unplugin-time-stat/webpack')({\n        /* options */\n      })\n    ]\n  }\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eesbuild\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// esbuild.config.js\nimport { build } from 'esbuild'\nimport TimeStat from 'unplugin-time-stat/esbuild'\n\nbuild({\n  plugins: [TimeStat()]\n})\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRspack\u003c/summary\u003e\u003cbr\u003e\n\n```ts\n// rspack.config.js\nmodule.exports = {\n  /* ... */\n  plugins: [\n    require('unplugin-time-stat/rspack')({\n      /* options */\n    })\n  ]\n}\n```\n\n\u003cbr\u003e\u003c/details\u003e\n\n## 🛠️ Plugin options\n\nSee the [here](https://github.com/kazupon/unplugin-time-stat/blob/main/src/types.ts)\n\n## 🙌 Contributing guidelines\n\nIf you are interested in contributing to `unplugin-time-stat`, I highly recommend checking out [the contributing guidelines](/CONTRIBUTING.md) here. You'll find all the relevant information such as [how to make a PR](/CONTRIBUTING.md#pull-request-guidelines), [how to setup development](/CONTRIBUTING.md#development-setup)) etc., there.\n\n## ©️ License\n\n[MIT](https://opensource.org/licenses/MIT)\n\n\u003c!-- Badges --\u003e\n\n[npm-version-src]: https://img.shields.io/npm/v/unplugin-time-stat?style=flat\n[npm-version-href]: https://npmjs.com/package/unplugin-time-stat\n[npm-downloads-src]: https://img.shields.io/npm/dm/unplugin-time-stat?style=flat\n[npm-downloads-href]: https://npmjs.com/package/unplugin-time-stat\n[ci-src]: https://github.com/kazupon/unplugin-time-stat/actions/workflows/ci.yml/badge.svg\n[ci-href]: https://github.com/kazupon/unplugin-time-stat/actions/workflows/ci.yml\n","funding_links":["https://github.com/sponsors/kazupon"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazupon%2Funplugin-time-stat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkazupon%2Funplugin-time-stat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazupon%2Funplugin-time-stat/lists"}