moodring
Local Deno package imports: Use package's deno.json config "exports" map?
I'm working in a Deno workspace where the outer workspace
deno.json
references a project within (at some sub-dir path).
- The project's deno.json
uses the "exports" option to map "."
to "./src/mod.ts"
.
- The workspace root's deno.json
then references this directory in the "imports"
map, from "package-a"
to "./package-a"
.
I would infer/expect (incorrectly?) based on Deno + JSR's import docs, that the outer workspace's import would use the values found in project-a's "exports" map. Running the project returns the following error:
Is my assumption incorrect? Is there something else wrong with my setup?
Ultimately, what I'd like is to respect the package's "exports"
values, such that 1) I can import with a short specifier, and 2) I can reference either a local directory or the package on JSR without changing any import code.10 replies