kingbriK
Denoβ€’17mo agoβ€’
1 reply
kingbri

Cannot use import maps

Hi there,

I'm trying to make a project root alias
@
so I don't have to suffer through relative path import hell (
../../../../file.ts
)

However, when I specify
"@/": "./"
in the imports section of
deno.json
, I get an error from VSCode stating this:

The import specifier can be remapped to "@/absolutePath/file.ts" which will resolve it via the active import map.


Therefore, I either have to use absolute imports for every file or use only relative imports. I want to be able to use both.

Is converting the project root to
@/
not possible without some sort of
src
directory? Thanks in advance.
Was this page helpful?