Skip to content

Commit

Permalink
docs: document toHTML
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalsadhu committed Oct 9, 2024
1 parent 4576ddd commit c5e0775
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,33 @@ await client.load();
client.base(); // http://localhost:8080/assets
```

### .toHTML()

Constructs an HTML import map script tag for use in the document head when doing import mapping.

```js
const client = new Eik({
loadMaps: true,
...
});
await client.load();

const html = `
<html>
<head>
...
${client.toHTML()}
...
</head>
<body>
...
</body>
</html>
`;
```

Due to browsers being restricted to a single import map, all import maps registered in eik.json or package.json will be merged down into a single import map with last in winning in case of duplicate keys.

## License

Copyright (c) 2021 FINN.no
Expand Down

0 comments on commit c5e0775

Please sign in to comment.