{"id":50320221,"url":"https://github.com/silverwind/rolldown-license-plugin","last_synced_at":"2026-05-29T03:03:57.898Z","repository":{"id":349841250,"uuid":"1204151065","full_name":"silverwind/rolldown-license-plugin","owner":"silverwind","description":"Rolldown plugin to extract dependency licenses and optionally validate them. Zero dependencies, optimized for performance.","archived":false,"fork":false,"pushed_at":"2026-05-24T08:53:38.000Z","size":358,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-24T10:25:40.885Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silverwind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-07T18:32:19.000Z","updated_at":"2026-05-24T08:53:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/silverwind/rolldown-license-plugin","commit_stats":null,"previous_names":["silverwind/rolldown-license-plugin"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/silverwind/rolldown-license-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Frolldown-license-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Frolldown-license-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Frolldown-license-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Frolldown-license-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silverwind","download_url":"https://codeload.github.com/silverwind/rolldown-license-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Frolldown-license-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33634615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2026-05-29T03:03:57.202Z","updated_at":"2026-05-29T03:03:57.889Z","avatar_url":"https://github.com/silverwind.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rolldown-license-plugin\n\n[![](https://img.shields.io/npm/v/rolldown-license-plugin.svg?style=flat)](https://www.npmjs.org/package/rolldown-license-plugin) [![](https://img.shields.io/npm/dm/rolldown-license-plugin.svg)](https://www.npmjs.org/package/rolldown-license-plugin) [![](https://packagephobia.com/badge?p=rolldown-license-plugin)](https://packagephobia.com/result?p=rolldown-license-plugin) [![](https://depx.co/api/badge/rolldown-license-plugin)](https://depx.co/pkg/rolldown-license-plugin)\n\nRolldown plugin to extract dependency licenses and optionally validate them. Zero dependencies, optimized for performance.\n\n## Usage\n\n```js\nimport {defineConfig} from \"rolldown\";\nimport {licensePlugin} from \"rolldown-license-plugin\";\n\nexport default defineConfig({\n  plugins: [\n    licensePlugin({\n      done(deps, context) {\n        context.emitFile({\n          type: \"asset\",\n          fileName: \"licenses.txt\",\n          source: deps.map(({name, version, license, licenseText}) =\u003e {\n            return `${name}@${version} - ${license}\\n${licenseText}`;\n          }).join(\"\\n\\n\"),\n        });\n      },\n    }),\n  ],\n});\n```\n\nThis also works with Vite, using `defineConfig` from `vite`.\n\n## API\n\n### `licensePlugin(opts)`\n\nReturns the plugin.\n\n#### `opts.done`\n\nType: `(licenses: LicenseInfo[], context: PluginContext) =\u003e void | Promise\u003cvoid\u003e`\n\nCallback invoked during `generateBundle` with the collected license data. The `context` parameter provides access to rolldown's plugin context, including `emitFile`.\n\n#### `opts.match`\n\nType: `RegExp`\\\nDefault: `/^((UN)?LICEN(S|C)E|COPYING).*$/i`\n\nRegex to match license filenames in package directories.\n\n#### `opts.wrapLicenseText`\n\nType: `number`\\\nDefault: `undefined` (no wrapping)\n\nWhen set, word-wrap `licenseText` to this column width.\n\n#### `opts.allow`\n\nType: `(license: LicenseInfo) =\u003e boolean`\\\nDefault: `undefined` (no validation)\n\nValidate each dependency's license. Return `false` to reject it. By default, rejected dependencies are reported via the rolldown plugin context's `warn`. Use `failOnViolation` and `failOnUnlicensed` to throw build errors instead.\n\n#### `opts.failOnViolation`\n\nType: `boolean`\\\nDefault: `false`\n\nThrow a build error when a dependency has an incompatible license.\n\n#### `opts.failOnUnlicensed`\n\nType: `boolean`\\\nDefault: `false`\n\nThrow a build error when a dependency does not specify any license.\n\n### `LicenseInfo`\n\n```typescript\ntype LicenseInfo = {\n  name: string;        // package name\n  version: string;     // package version, or \"\"\n  license: string;     // SPDX license identifier from package.json, or \"\"\n  licenseText: string; // contents of LICENSE/COPYING file, or \"\"\n};\n```\n\n### `wrap(text, width)`\n\nFunction to word-wrap `text` to a certain column `width`. Returns the wrapped string.\n\n## License\n\n© [silverwind](https://github.com/silverwind), distributed under BSD-2-Clause.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverwind%2Frolldown-license-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilverwind%2Frolldown-license-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverwind%2Frolldown-license-plugin/lists"}