# make-import-map

> Generate and serve import maps

Latest version **1.2.0** (published 2023-02-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install make-import-map
pnpm add make-import-map
yarn add make-import-map
bun add make-import-map
```

Provides the command `make-import-map`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2023-02-18 |
| First published | 2022-05-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | dwbinns |

## Links

- npm: https://www.npmjs.com/package/make-import-map
- npm.io page: https://npm.io/package/make-import-map

## Dependencies (1)

- [fs-serve](https://npm.io/package/fs-serve.md) ^3.0.0

## Recent versions

- 1.2.0 (latest) — 2023-02-18
- 1.1.1 — 2022-08-10
- 1.0.0 — 2022-05-26

## README

# Make import maps

Import maps allow a browser to know where to load ES modules from. Bundler not required.

See [https://github.com/WICG/import-maps]

## Example usage:

Create an HTML file, for example:

```html
<html>
<head>
  <!--#importmap-->
</head>
<body>
  <script type="module">
    import which from "which-export";
    document.body.append(which);
  </script>
</body>
</html>
```

Run a development server (either by installing this package globally or create an npm script).
The path to serve should include all required `node_modules` directories and source files:

```
make-import-map serve .
```

The comment in HTML will be replaced by an import map. If `which-export` is a dependency in `package.json` and is installed then the import will load it from `node_modules`.

Build an import map for distribution:

```
make-import-map save . import-map.json
```

---
_Source: https://npm.io/package/make-import-map · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
