cdaringe
cdaringe2w ago

How to import relative JSR module from import map

Problem I expect the following to work, but it does not:
{
"imports": {
"@std/path/": "jsr:@std/path/posix/",
}
}
{
"imports": {
"@std/path/": "jsr:@std/path/posix/",
}
}
import { basename } from "@std/path/posix/basename"; // nope!
import { basename } from "@std/path/posix/basename"; // nope!
Discussion What are others doing in this scenario? Simply not using import maps?
6 Replies
2saturdayscode
it should work, let me try Strangely enough this works:
"imports": {
"@std/path": "jsr:@std/path/posix"
}
"imports": {
"@std/path": "jsr:@std/path/posix"
}
Give it a try
cdaringe
cdaringeOP2w ago
I think that's because https://github.com/denoland/std/blob/main/path/posix/mod.ts exists, which unfortunately doesn't progress me. thx for suggesting
GitHub
std/path/posix/mod.ts at main · denoland/std
The Deno Standard Library. Contribute to denoland/std development by creating an account on GitHub.
2saturdayscode
I don't think you are right, there's no jsr entry for that it's just the export
cdaringe
cdaringeOP6d ago
GitHub
std/path/deno.json at main · denoland/std
The Deno Standard Library. Contribute to denoland/std development by creating an account on GitHub.
cdaringe
cdaringeOP6d ago
i guess they added all of the modules, so it works because of the barrel of exports.
2saturdayscode
Yeah I see