How would you use tsconfig.json to enable shorter path aliases?
This tests TypeScript module resolution. A strong answer sets compilerOptions.baseUrl, maps paths like @/* to src/*, and warns bundlers need matching aliases. A red flag is omitting baseUrl or claiming paths alone changes runtime resolution.
This tests TypeScript module resolution and compiler configuration. A strong answer explains setting baseUrl to the project root, defining a paths entry mapping @/* to src/*, and clarifying that TypeScript uses this for compile-time resolution only. It should note that build tools like Vite or webpack need their own alias config to resolve those paths at bundle time. A red flag is suggesting file moves or believing tsconfig paths automatically alter runtime behavior without build tool support.
Read the original → typescriptlang.org
- #typescript
- #tsconfig
- #module-resolution
- #path-aliases
- #frontend-tooling
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.