NeahNew/node_modules/next/dist/esm/lib/find-root.js
2025-05-03 14:17:46 +02:00

19 lines
465 B
JavaScript

import { dirname } from 'path';
import findUp from 'next/dist/compiled/find-up';
export function findRootLockFile(cwd) {
return findUp.sync([
'pnpm-lock.yaml',
'package-lock.json',
'yarn.lock',
'bun.lock',
'bun.lockb'
], {
cwd
});
}
export function findRootDir(cwd) {
const lockFile = findRootLockFile(cwd);
return lockFile ? dirname(lockFile) : undefined;
}
//# sourceMappingURL=find-root.js.map