mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
feat: stabilise import maps (#9526)
This commit stabilises import maps by removing requirement on "--unstable" flag when "--import-map" flag is used.
This commit is contained in:
parent
7cd14f97c9
commit
0dc89c0a79
5 changed files with 11 additions and 41 deletions
|
@ -1,19 +1,9 @@
|
|||
## Import maps
|
||||
|
||||
> This is an unstable feature. Learn more about
|
||||
> [unstable features](../runtime/stability.md).
|
||||
|
||||
Deno supports [import maps](https://github.com/WICG/import-maps).
|
||||
|
||||
You can use import maps with the `--import-map=<FILE>` CLI flag.
|
||||
|
||||
Current limitations:
|
||||
|
||||
- single import map.
|
||||
- no fallback URLs.
|
||||
- Deno does not support `std:` namespace.
|
||||
- supports only `file:`, `http:` and `https:` schemes.
|
||||
|
||||
Example:
|
||||
|
||||
**import_map.json**
|
||||
|
@ -37,7 +27,7 @@ console.log(red("hello world"));
|
|||
Then:
|
||||
|
||||
```shell
|
||||
$ deno run --import-map=import_map.json --unstable color.ts
|
||||
$ deno run --import-map=import_map.json color.ts
|
||||
```
|
||||
|
||||
To use starting directory for absolute imports:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue