JS: avoids directory copies during build

pull/749/head
etiennept 11 months ago committed by GitHub
parent a976eb3efc
commit f354bc7546
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      js/build_package.js
  2. 1079
      js/package-lock.json
  3. 2
      js/package.json

@ -1,16 +1,6 @@
#! /usr/bin/env node
const fs = require("fs");
// We copy file to the new directory
fs.mkdirSync("pkg");
for (const file of fs.readdirSync("./pkg-web")) {
fs.copyFileSync(`./pkg-web/${file}`, `./pkg/${file}`);
}
for (const file of fs.readdirSync("./pkg-node")) {
fs.copyFileSync(`./pkg-node/${file}`, `./pkg/${file}`);
}
const pkg = JSON.parse(fs.readFileSync("./pkg/package.json"));
pkg.name = "oxigraph";
pkg.main = "node.js";

1079
js/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -10,7 +10,7 @@
"scripts": {
"fmt": "biome format . --write && biome check . --apply-unsafe && biome format . --write",
"test": "biome ci . && wasm-pack build --debug --target nodejs && mocha",
"build": "rm -rf pkg && wasm-pack build --release --target web --out-name web --out-dir pkg-web && wasm-pack build --release --target nodejs --out-name node --out-dir pkg-node && node build_package.js && rm -r pkg-web && rm -r pkg-node",
"build": "wasm-pack build --release --target web --out-name web && wasm-pack build --release --target nodejs --out-name node && node build_package.js",
"release": "npm run build && npm publish ./pkg",
"pack": "npm run build && npm pack ./pkg"
},

Loading…
Cancel
Save