Skip to content

Commit 856d460

Browse files
committed
Copy license into all npm packages
Fixes parcel-bundler#415
1 parent 482fc40 commit 856d460

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/build-npm.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ cliPkg.scripts = {
9393

9494
fs.writeFileSync(`${dir}/cli/package.json`, JSON.stringify(cliPkg, false, 2) + '\n');
9595
fs.copyFileSync(`${dir}/README.md`, `${dir}/cli/README.md`);
96+
fs.copyFileSync(`${dir}/LICENSE`, `${dir}/cli/LICENSE`);
9697

9798
function buildNode(triple, cpu, os, libc, t) {
9899
let name = `lightningcss.${t}.node`;
@@ -123,6 +124,7 @@ function buildNode(triple, cpu, os, libc, t) {
123124
fs.writeFileSync(`${dir}/npm/node-${t}/package.json`, JSON.stringify(pkg2, false, 2) + '\n');
124125
fs.copyFileSync(`${dir}/artifacts/bindings-${triple}/${name}`, `${dir}/npm/node-${t}/${name}`);
125126
fs.writeFileSync(`${dir}/npm/node-${t}/README.md`, `This is the ${triple} build of lightningcss. See https://github.com/parcel-bundler/lightningcss for details.`);
127+
fs.copyFileSync(`${dir}/LICENSE`, `${dir}/npm/node-${t}/LICENSE`);
126128
}
127129

128130
function buildCLI(triple, cpu, os, libc, t) {
@@ -154,4 +156,5 @@ function buildCLI(triple, cpu, os, libc, t) {
154156
fs.copyFileSync(`${dir}/artifacts/bindings-${triple}/${binary}`, `${dir}/npm/cli-${t}/${binary}`);
155157
fs.chmodSync(`${dir}/npm/cli-${t}/${binary}`, 0o755); // Ensure execute bit is set.
156158
fs.writeFileSync(`${dir}/npm/cli-${t}/README.md`, `This is the ${triple} build of lightningcss-cli. See https://github.com/parcel-bundler/lightningcss for details.`);
159+
fs.copyFileSync(`${dir}/LICENSE`, `${dir}/npm/cli-${t}/LICENSE`);
157160
}

0 commit comments

Comments
 (0)