Skip to content

Commit

Permalink
docs(import_maps): Fix example for project-relative absolute specifie…
Browse files Browse the repository at this point in the history
  • Loading branch information
nayeemrmn committed Mar 22, 2021
1 parent 870337c commit 26f7a3f
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions docs/linking_to_external_code/import_maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
"/": "./"
"/": "./",
"./": "./"
}
}
```
Expand All @@ -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.

0 comments on commit 26f7a3f

Please sign in to comment.