DenoDDeno
Powered by
kingbriK
Denoβ€’16mo 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
../../../../file.ts
)

However, when I specify
"@/": "./"
"@/": "./"
in the imports section of
deno.json
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.
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
src
directory? Thanks in advance.
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Override npm import dep with import maps?
ZabiZZabi / help
4y ago
Using esbuild with import maps
kebKkeb / help
3y ago
Importing deno modules with import maps
sachawSsachaw / help
2y ago
How to define local import maps?
KawaxteKKawaxte / help
2y ago