Skip to content

Commit 396eb12

Browse files
authored
chore: add licenses to distributed code temporarily (#69)
1 parent dac1064 commit 396eb12

File tree

3 files changed

+186
-0
lines changed

3 files changed

+186
-0
lines changed

package-lock.json

Lines changed: 170 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"cross-spawn": "^7.0.6",
4646
"eslint": "^9.39.1",
4747
"prettier": "^3.6.2",
48+
"rollup-plugin-license": "^3.6.0",
4849
"tsdown": "^0.9.9",
4950
"typescript": "^5.9.3",
5051
"typescript-eslint": "^8.46.3",

tsdown.config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
import {defineConfig} from 'tsdown';
2+
import licenses from 'rollup-plugin-license';
23

34
export default defineConfig({
45
entry: 'src/main.ts',
56
target: 'es2022',
67
clean: true,
78
dts: true,
9+
plugins: [
10+
licenses({
11+
thirdParty: {
12+
output: {
13+
file: 'dist/LICENSES.txt',
14+
template(dependencies) {
15+
return dependencies.map((dependency) =>
16+
`${dependency.name}:${dependency.version} -- ${dependency.licenseText}`
17+
).join('\n');
18+
}
19+
}
20+
}
21+
}) as never
22+
],
823
outputOptions: {
924
minify: {
1025
mangle: true,

0 commit comments

Comments
 (0)