fortune-sheet/scripts/build.js
2022-04-25 18:55:14 +08:00

24 lines
616 B
JavaScript

const fs = require("fs");
const { spawnSync } = require("child_process");
const tsconfig = JSON.parse(fs.readFileSync("tsconfig.json"));
delete tsconfig.compilerOptions.paths;
tsconfig.include = ["./src"];
tsconfig.exclude = [
"node_modules",
"**/*.test.ts",
"**/*.spec.ts",
"dist",
"lib",
];
const tsconfigJson = JSON.stringify(tsconfig);
fs.writeFileSync("packages/core/tsconfig.json", tsconfigJson);
fs.writeFileSync("packages/react/tsconfig.json", tsconfigJson);
spawnSync("father-build", { stdio: "inherit" });
fs.rmSync("packages/core/tsconfig.json");
fs.rmSync("packages/react/tsconfig.json");