{"id":28599074,"url":"https://github.com/luxass/unplugin-build-meta","last_synced_at":"2026-01-31T10:12:57.305Z","repository":{"id":288279413,"uuid":"967405440","full_name":"luxass/unplugin-build-meta","owner":"luxass","description":"Provide build metadata as a virutal module","archived":false,"fork":false,"pushed_at":"2026-01-30T02:02:15.000Z","size":766,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-30T03:18:46.197Z","etag":null,"topics":["build","metadata","unplugin"],"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/luxass.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","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},"funding":{"github":"luxass"}},"created_at":"2025-04-16T12:06:08.000Z","updated_at":"2026-01-09T13:28:09.000Z","dependencies_parsed_at":"2025-06-11T12:11:35.975Z","dependency_job_id":"86b9bf0e-786b-4c2d-8f8f-d10cbf60d7d2","html_url":"https://github.com/luxass/unplugin-build-meta","commit_stats":null,"previous_names":["luxass/unplugin-build-meta"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/luxass/unplugin-build-meta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luxass%2Funplugin-build-meta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luxass%2Funplugin-build-meta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luxass%2Funplugin-build-meta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luxass%2Funplugin-build-meta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luxass","download_url":"https://codeload.github.com/luxass/unplugin-build-meta/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luxass%2Funplugin-build-meta/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28937921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T08:53:31.997Z","status":"ssl_error","status_checked_at":"2026-01-31T08:51:38.521Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["build","metadata","unplugin"],"created_at":"2025-06-11T12:11:30.061Z","updated_at":"2026-01-31T10:12:57.290Z","avatar_url":"https://github.com/luxass.png","language":"TypeScript","readme":"# unplugin-build-meta\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n\nImport build metadata into your JavaScript/TypeScript projects for Vite, Webpack, Rollup, esbuild and more. Powered by [unplugin](https://github.com/unjs/unplugin).\n\n\u003cp align=\"center\"\u003e\n\u003cbr /\u003e\n\u003ca href=\"https://stackblitz.com/github/luxass/unplugin-build-meta/tree/main/examples/vite?file=vite.config.ts\"\u003e\u003cimg src=\"https://developer.stackblitz.com/img/open_in_stackblitz.svg\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Install\n\n```bash\nnpm install -D unplugin-build-meta\n```\n\n## Usage\n\n\u003e [!TIP]\n\u003e You can view all examples [here](./examples).\n\n\u003cdetails\u003e\n\u003csummary\u003eVite\u003c/summary\u003e\u003cbr/\u003e\n\n```ts\n// vite.config.ts\nimport buildMeta from \"unplugin-build-meta/vite\";\n\nexport default defineConfig({\n  plugins: [\n    buildMeta({ /* options */ }),\n  ],\n});\n```\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 buildMeta from \"unplugin-build-meta/rollup\";\n\nexport default {\n  plugins: [\n    buildMeta({ /* options */ }),\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-build-meta/webpack\").default({ /* options */ }),\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    [\"unplugin-build-meta/nuxt\", { /* options */ }]\n  ],\n});\n```\n\n\u003cbr/\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAstro\u003c/summary\u003e\u003cbr/\u003e\n\n```ts\n// astro.config.mjs\nimport { defineConfig } from \"astro/config\";\nimport buildMeta from \"unplugin-build-meta/astro\";\n\n// https://astro.build/config\nexport default defineConfig({\n  integrations: [\n    buildMeta({\n      /* options */\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 buildMeta from \"unplugin-build-meta/esbuild\";\n\nbuild({\n  /* ... */\n  plugins: [\n    buildMeta({\n      /* options */\n    }),\n  ],\n});\n```\n\n\u003cbr/\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eFarm\u003c/summary\u003e\u003cbr/\u003e\n\n```ts\n// farm.config.ts\nimport { defineConfig } from \"@farmfe/core\";\nimport vue from \"@vitejs/plugin-vue\";\nimport buildMeta from \"unplugin-build-meta/farm\";\n\nexport default defineConfig({\n  vitePlugins: [\n    vue(),\n  ],\n  plugins: [\n    buildMeta({\n      /* options */\n    })\n  ]\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.mjs\nimport rspack from \"@rspack/core\";\nimport buildMeta from \"unplugin-build-meta/rspack\";\n\n/** @type {import('@rspack/core').Configuration} */\nexport default {\n  plugins: [\n    new rspack.HtmlRspackPlugin({\n      template: \"./index.html\"\n    }),\n    buildMeta()\n  ],\n};\n```\n\n\u003cbr/\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRolldown (Experimental)\u003c/summary\u003e\u003cbr/\u003e\n\n```ts\n// rolldown.config.js\nimport { defineConfig } from \"rolldown\";\nimport buildMeta from \"unplugin-build-meta/rolldown\";\n\nexport default defineConfig({\n  input: \"./index.js\",\n  plugins: [\n    buildMeta({\n      /* options */\n    }),\n  ],\n});\n```\n\n\u003cbr/\u003e\u003c/details\u003e\n\n## Configuration\n\n```ts\nbuildMeta({\n  // Whether to enable the git module (enabled by default)\n  git: true,\n\n  // Additional custom modules to include\n  extraModules: [\n    // Your custom modules here\n  ]\n});\n```\n\nBy default, the git module is enabled. You can:\n- Disable the git module by setting `git: false`\n- Add custom modules using the `extraModules` array\n- Create custom modules using `defineBuildMetaModule`\n\n## Modules\n\n### Git Module\n\nThe git module provides access to repository metadata from your code.\n\nImport it in your code:\n\n```ts\n// Import all git metadata\nimport * as git from \"virtual:build-meta/git\";\n\n// Or import specific values\nimport { branch, sha, shortSha } from \"virtual:build-meta/git\";\n```\n\nAvailable properties (all properties are nullable):\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `branch` | `string \\| null` | Current git branch name |\n| `sha` | `string \\| null` | Full git commit hash |\n| `shortSha` | `string \\| null` | First 10 characters of the commit hash |\n| `latestCommitMessage` | `string \\| null` | Latest commit message |\n| `commitAuthorName` | `string \\| null` | Commit author name |\n| `commitAuthorEmail` | `string \\| null` | Commit author email |\n| `commitAuthorDate` | `string \\| null` | Commit author date |\n| `commitCommitterName` | `string \\| null` | Committer name |\n| `commitCommitterEmail` | `string \\| null` | Committer email |\n| `commitCommitterDate` | `string \\| null` | Committer date |\n| `tag` | `string \\| null` | Current tag (if any) |\n| `tags` | `string[] \\| null` | All tags pointing at current commit |\n| `lastTag` | `string \\| null` | Latest tag in the repository |\n| `repositoryUrl` | `string \\| null` | Repository URL (for GitHub repositories) |\n\n### Runtime Module\n\nThe runtime module provides access to Node.js runtime information from your code.\n\nImport it in your code:\n\n```ts\n// Import all runtime information\nimport * as runtime from \"virtual:build-meta/runtime\";\n\n// Or import specific values\nimport { arch, platform, versions } from \"virtual:build-meta/runtime\";\n```\n\nAvailable properties:\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `platform` | `NodeJS.Platform` | The operating system platform (e.g., 'linux', 'darwin', 'win32') |\n| `arch` | `NodeJS.Architecture` | The CPU architecture (e.g., 'x64', 'arm64') |\n| `versions` | `NodeJS.ProcessVersions` | Version strings of Node.js and its dependencies |\n\n### TypeScript\n\nTo get proper type support, make sure to include the type declarations:\n\n```json\n{\n  \"compilerOptions\": {\n    \"types\": [\n      \"unplugin-build-meta/types\"\n    ]\n  }\n}\n```\n\n## 📄 License\n\nPublished under [MIT License](./LICENSE).\n\n[npm-version-src]: https://img.shields.io/npm/v/unplugin-build-meta?style=flat\u0026colorA=18181B\u0026colorB=4169E1\n[npm-version-href]: https://npmjs.com/package/unplugin-build-meta\n[npm-downloads-src]: https://img.shields.io/npm/dm/unplugin-build-meta?style=flat\u0026colorA=18181B\u0026colorB=4169E1\n[npm-downloads-href]: https://npmjs.com/package/unplugin-build-meta\n","funding_links":["https://github.com/sponsors/luxass"],"categories":["Plugins"],"sub_categories":["Unplugin"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluxass%2Funplugin-build-meta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluxass%2Funplugin-build-meta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluxass%2Funplugin-build-meta/lists"}