feat(projects): 本地svg动态渲染图标

ISSUES CLOSED: #61
This commit is contained in:
Soybean
2022-06-16 01:17:31 +08:00
parent 833018a831
commit c3c975ee11
16 changed files with 1067 additions and 63 deletions

20
build/utils/index.ts Normal file
View File

@ -0,0 +1,20 @@
import path from 'path';
/**
* 获取项目根路径
* @descrition 结尾不带斜杠
*/
export function getRootPath() {
return path.resolve(process.cwd());
}
/**
* 获取项目src路径
* @param srcName - src目录名称(默认: "src")
* @descrition 结尾不带斜杠
*/
export function getSrcPath(srcName = 'src') {
const rootPath = getRootPath();
return `${rootPath}/${srcName}`;
}