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.

16 lines
279 B
TypeScript

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