You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
314 B
TypeScript

import path from 'node:path'
import process from 'node:process'
/**
* 获取项目根路径,不包括末尾斜杠
*/
export function getRootPath() {
return path.resolve(process.cwd())
}
/**
* 获取项目src路径
*/
export function getSrcPath(srcName = 'src') {
return `${getRootPath()}/${srcName}`
}