1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

docs(import_maps): Fix example for project-relative absolute specifiers (#9856)

This commit is contained in:
Nayeem Rahman 2021-03-22 20:13:50 +00:00 committed by Kitson Kelly
parent f50ed4e281
commit 7dabb3dc54
No known key found for this signature in database
GPG key ID: 2D87CFF11B51960A

View file

@ -30,14 +30,15 @@ Then:
$ deno run --import-map=import_map.json color.ts
```
To use starting directory for absolute imports:
To use your project root for absolute imports:
**import_map.json**
```jsonc
{
"imports": {
"/": "./"
"/": "./",
"./": "./"
}
}
```
@ -48,14 +49,5 @@ To use starting directory for absolute imports:
import { MyUtil } from "/util.ts";
```
You may map a different directory: (eg. src)
**import_map.json**
```jsonc
{
"imports": {
"/": "./src/"
}
}
```
This causes import specifiers starting with `/` to be resolved relative to the
import map's URL or file path.