29 lines
675 B
JavaScript
29 lines
675 B
JavaScript
/**
|
|
* Remove local build artifacts (safe; does not touch source).
|
|
*/
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
|
|
const targets = [
|
|
".next",
|
|
"tsconfig.tsbuildinfo",
|
|
"apps/admin/dist",
|
|
"apps/taro/web/dist",
|
|
"apps/taro/admin/dist",
|
|
"apps/miniprogram/weapp/dist",
|
|
"apps/miniprogram/tt/dist",
|
|
];
|
|
|
|
function rm(p) {
|
|
const full = path.join(root, p);
|
|
if (!fs.existsSync(full)) return;
|
|
fs.rmSync(full, { recursive: true, force: true });
|
|
console.log("removed", p);
|
|
}
|
|
|
|
for (const t of targets) rm(t);
|
|
console.log("clean done");
|