Native support for tsconfig's paths resolution
See original GitHub issueClear and concise description of the problem
By having Typescript integration in Vite, I kind of assumed all tsconfig features would work out-of-the-box. While migrating from Next.js I discovered that Vite is lacking support for paths
resolving. I noticed that many of my friends did that as well, although I would be in favour of adding a full typescript features support.
Suggested solution
Add native support for paths
resolutions similar to: https://www.npmjs.com/package/vite-tsconfig-paths
Alternative
Document lack of this feature in Typescript section and recommend using: https://www.npmjs.com/package/vite-tsconfig-paths
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that request the same feature to avoid creating a duplicate.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:14
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Documentation - Module Resolution - TypeScript
The TypeScript compiler supports the declaration of such mappings using paths property in tsconfig.json files. Here is an example for how to specify...
Read more >tsconfig paths does not resolve in react native - Stack Overflow
I'm attempting to use TypeScript's paths option in my tsconfig.json file. I've used paths before in my other web applications using React.
Read more >tsconfig-paths - npm
Typescript by default mimics the Node.js runtime resolution strategy of modules. But it also allows the use of path mapping which allows ...
Read more >paths and baseUrl | ts-node - TypeStrong · GitHub
You can use ts-node together with tsconfig-paths to load modules according to ... the intended purpose for "paths" in "Additional module resolution flags"....
Read more >gatsby-plugin-tsconfig-paths
TSConfig Paths plugin for Gatsby Description This plugin will provide support for paths configured in your tsconfig by using . How to…
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My solution:
Works with my
tsconfig.json
:TSConfig
paths
only works for TypeScript / JavaScript modules (semantically). We need the alias for all kinds of resources. So I think it would be confusing to usepaths
exclusively.