-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.js
More file actions
executable file
·26 lines (23 loc) · 930 Bytes
/
build.js
File metadata and controls
executable file
·26 lines (23 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/node
const { execSync } = require("child_process");
const { rmSync, writeFileSync } = require("fs");
const { join } = require("path");
rmSync("dist", { recursive: true, force: true });
rmSync("types", { recursive: true, force: true });
try {
console.log("[MSMC]:Checking dependencies....");
console.log(execSync(`npm i`).toString("ascii"));
console.log("[MSMC]:Compiling commonjs....");
console.log(execSync(`tsc -b ./tsconfig.cjs.json`).toString("ascii"));
console.log("[MSMC]:Compiling es6....");
console.log(execSync(`tsc -b ./tsconfig.mjs.json`).toString("ascii"));
console.log("[MSMC]:Adding patch");
writeFileSync(
join("dist", "mjs", "package.json"),
JSON.stringify({ type: "module", private: true }),
);
console.log("[MSMC]:Constructing declarations....");
console.log(execSync(`tsc -b ./tsconfig.types.json`).toString("ascii"));
} catch (e) {
console.log(e.toString("ascii"));
}