diff options
author | Vincent Victoria <vincent@vincentvictoria.com> | 2020-06-27 20:52:07 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-27 13:52:07 +0200 |
commit | 6be3487f73313b8928a325c56a2f1914dada7db0 (patch) | |
tree | 46a7e444edc260bc43d33baa8cbd9336c5fc7061 /docs/linking_to_external_code | |
parent | 6f3ad0f73aba22142fbd0036e18a2b40317b8f60 (diff) |
docs: Update import_maps.md to include more examples (#5648)
Diffstat (limited to 'docs/linking_to_external_code')
-rw-r--r-- | docs/linking_to_external_code/import_maps.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/linking_to_external_code/import_maps.md b/docs/linking_to_external_code/import_maps.md index 1e993dbc9..21b0477e4 100644 --- a/docs/linking_to_external_code/import_maps.md +++ b/docs/linking_to_external_code/import_maps.md @@ -39,3 +39,33 @@ Then: ```shell $ deno run --importmap=import_map.json --unstable color.ts ``` + +To use staring directory for absolute imports: + +```json +// import_map.json + +{ + "imports": { + "/": "./" + } +} +``` + +```ts +// main.ts + +import { MyUtil } from "/util.ts"; +``` + +You may map a different directory: (eg. src) + +```json +// import_map.json + +{ + "imports": { + "/": "./src" + } +} +``` |