Files
test-repo/scripts/build/utils.js
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
341 B
JavaScript
Raw Normal View History

import fs from "node:fs";
import path from "node:path";
2023-03-28 16:18:53 +08:00
import { PROJECT_ROOT } from "../utils/index.js";
function getPackageFile(file) {
const resolved = path.join(PROJECT_ROOT, `node_modules/${file}`);
if (!fs.existsSync(resolved)) {
throw new Error(`'${file}' not exist.`);
}
return resolved;
}
export { getPackageFile };