Path mapping
TypeScript's paths compiler option remaps import specifiers for type resolution. It does not rewrite emitted imports, so your runtime or bundler must understand the same aliases.
baseUrl is not required for paths and is deprecated in TypeScript 6. Prefer paths relative to the tsconfig.json file:
{
"compilerOptions": {
"paths": {
"@app/*": ["./src/*"]
}
}
}If you have a project that uses this functionality, you can configure the internal generators either by:
- letting
tsoa-nextread compiler options from atsconfig.json - overriding specific values with
compilerOptionsin yourtsoaconfig
tsconfig.json is an input source, not the final authority. The precedence is:
- TypeScript internal defaults
- resolved
tsconfig.json - explicit
compilerOptionsintsoaconfig
If tsconfig is omitted, tsoa-next looks for tsconfig.json starting from the loaded tsoa config directory. If tsconfig is provided, it is resolved relative to that config file.
{
"tsconfig": "./tsconfig.json",
"spec": {
...
},
"routes": {
...
},
"compilerOptions": {
"paths": {
"exampleLib": ["./path/to/example/lib"]
}
}
}You can also continue to provide compiler options directly when you do not want to rely on tsconfig.json.
{
"spec": {
...
},
"routes": {
...
},
"compilerOptions": {
"paths": {
"exampleLib": ["./path/to/example/lib"]
}
}
}