Skip to content

Commit

Permalink
doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
dmail committed Jan 3, 2024
1 parent d1d3ce6 commit 1a55876
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ The following conditions will be picked:
#### importResolution
_importResolution_ is an object. When passed the generated mappings will be used to resolve js imports found in entryPoints and their transitive dependencies. When a js import cannot be resolved a warning is logged.
_importResolution_ is an object. When passed the generated mappings will be used to resolve js imports found in entryPoints and their transitive dependencies. When a js import cannot be resolved a warning is logged. It is recommended to use _importResolution_ as it gives confidence in the generated importmap.
_importResolution_ is optional. When the importmap file is written inside a file ending with `.html` the import resolution starts from the `.html` file. Otherwise _importResolution.entryPoints_ must be configured.
Expand All @@ -184,8 +184,6 @@ _importResolution.entryPoints_ is an array composed of string representing file
_importResolution.entryPoints_ is optional.
It is recommended to use _importResolution.entryPoints_ as it gives confidence in the generated importmap.
##### importResolution.magicExtensions
_importResolution.magicExtensions_ is an array of strings. Each string represent an extension that will be tried when an import cannot be resolved to a file.
Expand Down Expand Up @@ -233,7 +231,7 @@ import { writeFile } from "node:fs";
_importResolution.runtime_ is optional and defaults to `"browser"`.
#### importResolution.keepUnusedMappings
##### importResolution.keepUnusedMappings
_importResolution.keepUnusedMappings_ is a boolean. When enabled mappings will be kept even if not currently used by import found in js files.
Expand All @@ -254,8 +252,6 @@ await writeImportmaps({
});
```
It is recommended to enable _removeUnusedMappings_ so that importmap contains only the mappings actually used by your codebase.
#### manualImportmap
_manualImportmap_ is an object containing mappings that will be added to the importmap. This can be used to provide additional mappings and/or override node mappings.
Expand Down Expand Up @@ -316,7 +312,7 @@ At the time of writing this documentation external importmap are not supported b
External import maps are not yet supported
```
If you plan to use importmap in a web browser you need to tell `@jsenv/importmap-node-module` to inline importmap into the HTML file as shown in [API](#API).
If you plan to use importmap in a web browser you need to tell `@jsenv/importmap-node-module` to inline importmap into the HTML file as shown in [CLI](#CLI).
# TypeScript
Expand All @@ -343,7 +339,7 @@ import { writeImportmaps } from "@jsenv/importmap-node-module";
await writeImportmaps({
directoryUrl: new URL("./dist/", import.meta.url),
importmaps: {
"./demo.html": {
"./index.html": {
importResolution: {
magicExtensions: ["inherit"],
},
Expand Down

0 comments on commit 1a55876

Please sign in to comment.