// gulpfile.jsgulp.src(entry).pipe(alias({configuration: tsProject.config})).pipe(tsProject()).pipe(gulp.dest('./dist'));// src/server/controllers/index.tsimportIndexControllerfrom'@/controllers/IndexController';// cannot find module “@/controllers/IndexController” or other type declarations
// src/server/controllers/IndexController.tsimportKoafrom'koa';exportdefaultclassIndexController{constructor(){}asyncactionIndex(ctx: Koa.Context,next: Koa.Next){constbooks=newBooks();constres=awaitbooks.getData();ctx.body=res;}}// tsconfig.json
{
"compilerOptions": {
"target": "es5" ,
"module": "commonjs",
"paths": {
"@/controllers": ["./src/server/controllers"],
"@/models": ["./src/server/models"]
} ,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}Although the app run normally, I want to resolve the errors in index.ts
// tsconfig.json
{ "compilerOptions": { "target": "es5" , "module": "commonjs", "paths": { "@/controllers": ["./src/server/controllers"], "@/models": ["./src/server/models"] } , "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true } }Although the app run normally, I want to resolve the errors in index.ts