{"id":24265959,"url":"https://github.com/lukehackett/vite-plugin-build-info-file","last_synced_at":"2026-03-07T08:33:08.251Z","repository":{"id":270567116,"uuid":"910603764","full_name":"LukeHackett/vite-plugin-build-info-file","owner":"LukeHackett","description":"Vite plugin that generates build information and outputs it as a json file","archived":false,"fork":false,"pushed_at":"2025-10-04T20:33:23.000Z","size":202,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-27T12:09:21.079Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vite-plugin-build-info-file","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/LukeHackett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-31T19:28:13.000Z","updated_at":"2025-10-24T12:43:28.000Z","dependencies_parsed_at":"2025-01-01T21:30:27.315Z","dependency_job_id":"f6f80f78-6ea0-48fc-9724-22d67d7490f7","html_url":"https://github.com/LukeHackett/vite-plugin-build-info-file","commit_stats":null,"previous_names":["lukehackett/vite-plugin-build-info","lukehackett/vite-plugin-build-info-file"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/LukeHackett/vite-plugin-build-info-file","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeHackett%2Fvite-plugin-build-info-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeHackett%2Fvite-plugin-build-info-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeHackett%2Fvite-plugin-build-info-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeHackett%2Fvite-plugin-build-info-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukeHackett","download_url":"https://codeload.github.com/LukeHackett/vite-plugin-build-info-file/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeHackett%2Fvite-plugin-build-info-file/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30209939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-01-15T10:58:40.478Z","updated_at":"2026-03-07T08:33:08.206Z","avatar_url":"https://github.com/LukeHackett.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Project Introduction --\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/LukeHackett/vite-plugin-build-info-file\"\u003e\n    \u003cimg src=\"./.github/docs/logo.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003evite-plugin-build-info-file\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    A \u003ca href=\"https://vite.dev\"\u003evite\u003c/a\u003e plugin that generates build information and outputs it as a json file.\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.npmjs.com/package/vite-plugin-build-info-file\"\u003e\n      \u003cimg src=\"https://img.shields.io/npm/dt/vite-plugin-build-info-file?style=flat-square\" alt=\"NPM\" /\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/LukeHackett/vite-plugin-build-info-file?label=GitHub%20Stars\u0026style=flat-square\" alt=\"GitHub Repository Stars\" /\u003e\n    \u003ca href=\"https://github.com/LukeHackett/vite-plugin-build-info-file/blob/main/LICENSE\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/license/LukeHackett/vite-plugin-build-info-file?style=flat-square\" alt=\"License\" /\u003e\n    \u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/github/last-commit/LukeHackett/vite-plugin-build-info-file?style=flat-square\" alt=\"Last Commit\" /\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/LukeHackett/vite-plugin-build-info-file/build.yml?branch=main\u0026style=flat-square\" alt=\"Build Status\" /\u003e\n    \u003ca href=\"https://github.com/LukeHackett/vite-plugin-build-info-file/issues\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/issues/LukeHackett/vite-plugin-build-info-file?style=flat-square\" alt=\"Issues\" /\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003c!-- Core Features --\u003e\n## Features\n\n- Generates a json file within the build folder for serving alongside the application.\n- Supports `git`, `node`, `package.json` and `platform` contributors out of the box.\n- Supports custom contributors for integrating with custom data sources.\n\n\u003c!-- Getting Started --\u003e\n## Installation\n\nYou can add it as a dev dependency via your package manager of choice, e.g. NPM, Yarn, PNPM.\n\n```bash\nnpm install --save-dev vite-plugin-build-info-file\n```\n\n\u003c!-- Usage --\u003e\n## Usage\n\n```ts\n// vite.config.js\nimport { defineConfig } from \"vite\";\nimport buildInfoFile from \"vite-plugin-build-info-file\";\n\nexport default defineConfig({\n  plugins: [\n    buildInfoFile({\n      /* (optional) pass your config */\n    })\n  ]\n})\n```\n\nThe default configuration will result in an `info.json` file (see example below) being emitted within the `dist` folder of your project\n\n```json\n{\n  \"git\": {\n    \"branch\": \"main\",\n    \"commit\": {\n      \"id\": \"647b8d6\",\n      \"tags\": [],\n      \"time\": \"1736356630\"\n    }\n  },\n  \"node\": {\n    \"version\": \"v20.18.1\"\n  },\n  \"package\": {\n    \"name\": \"my-app\",\n    \"version\": \"1.0.0\"\n  },\n  \"platform\": {\n    \"arch\": \"arm64\",\n    \"platform\": \"darwin\"\n  }\n}\n```\n\n### Configuration\n\nThe following configuration options can be passed the `buildInfoFile` plugin function.\n\n```ts\nexport type BuildInfoFilePluginConfig = {\n  /**\n   * The name of the file to be generated, defaults to 'info.json'.\n   */\n  filename?: string;\n\n  /**\n   * Key/Value pairs to be injected into the file info.json file.\n   */\n  info?: Json;\n\n  /**\n   * Configuration for each contributor. By default all contributors are enabled.\n   */\n  contributors?:\n    | {\n        git?: GitContributorConfig;\n        node?: ContributorConfig;\n        package?: ContributorConfig;\n        platform?: ContributorConfig;\n      }\n    | { [key: string]: Contributor\u003cContributorConfig\u003e };\n};\n```\n\n#### Custom Contributors\n\nBesides the pre-defined contributors, it is possible to create custom contributors.\n\nEach contributor should implement the `Contributor` type, which is a function that returns a `Promise\u003cJson\u003e` value.\n\nAn example implementation is shown below:\n\n```ts\n// vite.config.js\nimport { defineConfig } from \"vite\";\nimport buildInfoFile from \"vite-plugin-build-info-file\";\n\nconst helloWorldContributor: Contributor\u003cContributorConfig\u003e = (config: ContributorConfig): Promise\u003cJson\u003e =\u003e {\n  return Promise.resolve({ message: 'Hello World!' });\n}\n\nexport default defineConfig({\n  plugins: [\n    buildInfoFile({\n      contributors: {\n        myContributor: helloWorldContributor\n      }\n    })\n  ]\n})\n```\n\nThis will generate the following `info.json` file:\n\n```json\n{\n  \"myContributor\": {\n    \"message\": \"Hello World\"\n  }\n  // other contributors have been omitted\n}\n```\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.\n\nPlease review the [Contributing Guidelines](./CONTRIBUTING.md) if you would like to make a contribution to this project.\n\n## Issues\n\nIf you encounter any other bugs or need some other features feel free to open an [issue](https://github.com/LukeHackett/vite-plugin-build-info-file/issues).\n\n## License\n\nDistributed under the MIT License. See [LICENSE.md](./LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukehackett%2Fvite-plugin-build-info-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukehackett%2Fvite-plugin-build-info-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukehackett%2Fvite-plugin-build-info-file/lists"}