import map options, can be an optional bag of { map?, mapUrl?, rootUrl? } or just a direct mapUrl
Extends the import map mappings
Import map to extend with
Set to true to have scopes be replacing instead of extending
ImportMap for chaining
Performs an alphanumerical sort on the import map imports and scopes
ImportMap for chaining
Set a specific entry in the import map
Specifier to set
Target of the map
Optional
parent: stringOptional parent scope
ImportMap for chaining
URL target
Integrity
URL target
Integrity
Bulk replace URLs in the import map Provide a URL ending in "/" to perform path replacements
{String} The URL to replace
{String} The URL to replace it with
ImportMap for chaining
Groups subpath mappings into path mappings when multiple exact subpaths exist under the same path.
For two mappings like { "base/a.js": "/a.js", "base/b.js": "/b.js" }, these will be replaced with a single path mapping { "base/": "/" }. Groupings are done throughout all import scopes individually.
ImportMap for chaining
Groups the import map scopes to shared URLs to reduce duplicate mappings.
For two given scopes, "https://site.com/x/" and "https://site.com/y/", a single scope will be constructed for "https://site.com/" including their shared mappings, only retaining the scopes if they have differences.
In the case where the scope is on the same origin as the mapUrl, the grouped scope is determined based on determining the common baseline over all local scopes
ImportMap for chaining
Rebase the entire import map to a new mapUrl and rootUrl
If the rootUrl is not provided, it will remain null if it was already set to null.
Otherwise, just like the constructor options, the rootUrl will default to the mapUrl base if it is an http: or https: scheme URL, and null otherwise keeping absolute URLs entirely in-tact.
The new map URL to use
Optional
rootUrl: string | URLThe new root URL to use
ImportMap for chaining
Perform a module resolution against the import map
Specifier to resolve
Parent URL to resolve against
Resolved URL string
The absolute URL of the import map, for determining relative resolutions When using file:/// URLs this allows relative modules to be co-located
The URL to use for root-level resolutions in the import map If null, root resolutions are not resolved and instead left as-is
By default, rootUrl is null unless the mapUrl is an http or https URL, in which case it is taken to be the root of the mapUrl.
Create a new import map instance