HuLa/build/config/getPath.ts

21 lines
468 B
TypeScript
Raw Normal View History

2023-12-16 03:56:10 +08:00
//使用path需要按照@types/node依赖
import path from 'path'
/**
*
* @descrition
*/
export const getRootPath = () => {
return path.resolve(__dirname, process.cwd())
}
/**
* (src)
* @param mainName - src目录名称(: "src")
* @descrition
*/
export const getSrcPath = (mainName = 'src') => {
const rootPath = getRootPath()
return `${rootPath}/${mainName}`
}