在项目中引用中使用绝对路径
根目录新建 jsconfig.json or tsconfig.json内容如下:
{
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src"]
}
使用示范
# 文件项目路径 src/config/route
import Button from 'config/routes';
根目录新建 jsconfig.json or tsconfig.json内容如下:
{
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src"]
}
# 文件项目路径 src/config/route
import Button from 'config/routes';