Skip to content

Commit

Permalink
fix: include LICENSE in each package
Browse files Browse the repository at this point in the history
  • Loading branch information
uenoB committed Aug 5, 2024
1 parent 5118d97 commit 1df333a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/
node_modules/
packages/*/LICENSE
9 changes: 8 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ const cleanup = outDir => ({
buildStart: () => fs.rmSync(outDir, { recursive: true, force: true })
})

const copyLicense = dir => ({
name: 'copyFiles',
closeBundle() {
fs.copyFileSync('LICENSE', path.join(dir, 'LICENSE'))
}
})

const externalNames = ({ json }) => [
...Object.keys(json.dependencies ?? {}),
...Object.keys(json.peerDependencies ?? {})
Expand Down Expand Up @@ -66,7 +73,7 @@ const build = pkg => {
},
{
external: [...external, /^node:/],
plugins: [dts()],
plugins: [dts(), copyLicense(pkg.dir)],
input,
output: [
{ dir: outDir, entryFileNames: '[name].d.ts' },
Expand Down

0 comments on commit 1df333a

Please sign in to comment.