Skip to content

Commit

Permalink
Copy license into all npm packages
Browse files Browse the repository at this point in the history
Fixes #415
  • Loading branch information
devongovett committed Feb 12, 2023
1 parent 482fc40 commit 856d460
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/build-npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ cliPkg.scripts = {

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

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

function buildCLI(triple, cpu, os, libc, t) {
Expand Down Expand Up @@ -154,4 +156,5 @@ function buildCLI(triple, cpu, os, libc, t) {
fs.copyFileSync(`${dir}/artifacts/bindings-${triple}/${binary}`, `${dir}/npm/cli-${t}/${binary}`);
fs.chmodSync(`${dir}/npm/cli-${t}/${binary}`, 0o755); // Ensure execute bit is set.
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.`);
fs.copyFileSync(`${dir}/LICENSE`, `${dir}/npm/cli-${t}/LICENSE`);
}

0 comments on commit 856d460

Please sign in to comment.