#How to import relative JSR module from import map

1 messages · Page 1 of 1 (latest)

uncut iron
#

Problem

I expect the following to work, but it does not:

{
  "imports": {
    "@std/path/": "jsr:@std/path/posix/",
  }
}
import { basename } from "@std/path/posix/basename"; // nope!

Discussion

What are others doing in this scenario? Simply not using import maps?

#

How to import relative JSR module from import map

versed heron
#

it should work, let me try

#

Strangely enough this works:

"imports": {
    "@std/path": "jsr:@std/path/posix"
  }

Give it a try

uncut iron
versed heron
#

I don't think you are right, there's no jsr entry for that

#

it's just the export

uncut iron
#

i guess they added all of the modules, so it works because of the barrel of exports.