Replies: 5 comments 3 replies
-
Those options only inform the TypeScript type checker of the location of code at runtime. Because Deno manages the location of all code at runtime, these options would only make type checking or runtime code break. Deno uses the web standard import maps to relocate code both at type check and runtime. |
Beta Was this translation helpful? Give feedback.
-
But is there any specific reason to not resolve the paths during runtime? It is just a small thing but would make the live much easier as this huge collections of ../../ are def a source of error. |
Beta Was this translation helpful? Give feedback.
-
Just a small example - in deno.json:
then can do this anywhere -
|
Beta Was this translation helpful? Give feedback.
-
Just feedback, as it is very hard to migrate a Node.js project that uses |
Beta Was this translation helpful? Give feedback.
-
Bumped into this as well and would also advise this to be solved as you'd just be winning over users from Node+TS when you solve this. Having path aliases supported perhaps with a flag that is similar to I've noticed that Deno has already taken the route where one can get dependencies in place just based on package.json -- It's not a stretch then to go and be able to read paths config (at least simpler setups) from tsconfig.json In short, perhaps this strategy will benefit Deno the most:
|
Beta Was this translation helpful? Give feedback.
-
Hi, this issue comes for the reason of a limitation which I found when creating my projects in deno. I usually like to create a folder where I incorporate all the routes to third party modules and from there I export everything to include it from those files
ej: oak.ts
And I think that I am not the only one who does this, and that in a certain way it is a good practice to be able to visualize in the same point all the modules on which the project depends
However, this causes that, if I want to import what I have in the folder, there are relative paths in the project which will mess up readability a bit
For this reason, I consider that if it does include the possibility of establishing the
baseUrl
, and even the paths, in the tsconfig, it would greatly improve this aspect. Something that the typescript cli already brings with it.Beta Was this translation helpful? Give feedback.
All reactions