#Any suggestions on how I can get rid of the '../../' in this import path?
6 messages · Page 1 of 1 (latest)
@boreal violet It depends on the context. To do this you need both 1) to tell TS about this mapping (the paths property) and 2) you need something to actually resolve the mapping when your code runs.
If it's a UI packaged by a bundler, they'll have config for that (e.g. for Vite it's resolve.alias)
If you're writing a library I think this ends up being a bad idea
Personally, I try to avoid this nowadays and try to structure my code so that I don't have to do big ../.. imports - if related files are grouped together you can usually minimize it.
Yeah I am working on just that, now. File reorg.