1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-29 16:30:56 -05:00
denoland-deno/docs/linking_to_external_code/import_maps.md
2020-06-12 14:25:53 +02:00

694 B

Import maps

This is an unstable feature. Learn more about unstable features.

Deno supports import maps.

You can use import maps with the --importmap=<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

{
   "imports": {
      "fmt/": "https://deno.land/std@0.55.0/fmt/"
   }
}

color.ts

import { red } from "fmt/colors.ts";

console.log(red("hello world"));

Then:

$ deno run --importmap=import_map.json --unstable color.ts