Files
Pake/bin/utils/dir.ts
2023-07-06 11:00:15 +08:00

9 lines
348 B
TypeScript
Vendored

import path from 'path';
import { fileURLToPath } from 'url';
// Convert the current module URL to a file path
const currentModulePath = fileURLToPath(import.meta.url);
// Resolve the parent directory of the current module
export const npmDirectory = process.env.DEV === 'true' ? process.cwd() : path.join(path.dirname(currentModulePath), '..');