我正在尝试为我的模拟服务器设置别名。每当我尝试编译文件时,它都会返回错误,即使这些模块是在->ts
中定义的,它也找不到合适的模块tsconfig,json
paths
文件夹结构:
├── server
│ └── src
│ └──/json
├── src
│ └──/modules
├── tsconfig.json
这是我的tsconfig.json
{
"compilerOptions": {
"baseUrl": "./src",
"experimentalDecorators": true,
"jsx": "react",
"lib": [
"dom",
"es2015",
"es2015.promise"
],
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": true,
"noUnusedLocals": true,
"esModuleInterop": true,
"paths": {
"@project/app/modules/*": [
"modules/*"
],
"@project/server/data/*": [
"../server/src/json/*"
]
},
"sourceMap": true,
"target": "es5"
},
"exclude": [
"node_modules",
"tools"
]
}
错误:
Error: Cannot find module '@project/server/data/accounts/accountsList'