rolldown-license-plugin 2.2.3 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +11 -5
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -12,9 +12,15 @@ import {licensePlugin} from "rolldown-license-plugin";
12
12
  export default {
13
13
  plugins: [
14
14
  licensePlugin({
15
- done(deps) {
16
- console.info(deps);
17
- // => [{name, version, license, licenseText}]
15
+ done(deps, context) {
16
+ const content = deps.map(({name, version, license, licenseText}) => (
17
+ `${name} ${version} (${license})\n${licenseText}`
18
+ )).join("\n\n");
19
+ context.emitFile({
20
+ type: "asset",
21
+ fileName: "licenses.txt",
22
+ source: content,
23
+ });
18
24
  },
19
25
  }),
20
26
  ],
@@ -71,8 +77,8 @@ Throw a build error when a dependency does not specify any license.
71
77
  ```typescript
72
78
  type LicenseInfo = {
73
79
  name: string; // package name
74
- version: string; // package version
75
- license: string; // SPDX license identifier from package.json
80
+ version: string; // package version, or ""
81
+ license: string; // SPDX license identifier from package.json, or ""
76
82
  licenseText: string; // contents of LICENSE/COPYING file, or ""
77
83
  };
78
84
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown-license-plugin",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "description": "Rolldown plugin to extract dependency licenses",
5
5
  "author": "silverwind <me@silverwind.io>",
6
6
  "repository": "silverwind/rolldown-license-plugin",
@@ -32,6 +32,7 @@
32
32
  "updates": "17.14.0",
33
33
  "updates-config-silverwind": "2.0.1",
34
34
  "versions": "14.2.7",
35
+ "vite": "8.0.8",
35
36
  "vitest": "4.1.4",
36
37
  "vitest-config-silverwind": "11.1.4"
37
38
  }