Resolves uris basing on exact or prefix match of key from definitions.
In definitions, key is matched against input uri with following strategy:
key without trailing / -> key and input uri must be identical
key with trailing /, -> key is treated as "package prefix", so uri must start with
key
Example:
{
"local://poiMasterList": "/assets/poiMasterList.json"// will match only 'local://poiMasterList' and resolve `/assets/poiMasterList.json`
"local://icons/": "/assets/icons/"// will match only 'local://icons/ANYPATH' (and similar) and resolve to
// `/assets/icons/ANYPATH
}
Basic, import-map like UriResolver.
Resolves
uris
basing on exact or prefix match ofkey
fromdefinitions
.In definitions,
key
is matched against input uri with following strategy:key
without trailing/
->key
and inputuri
must be identicalkey
with trailing/
, ->key
is treated as "package prefix", souri
must start withkey
Example:
{ "local://poiMasterList": "/assets/poiMasterList.json" // will match only 'local://poiMasterList' and resolve `/assets/poiMasterList.json` "local://icons/": "/assets/icons/" // will match only 'local://icons/ANYPATH' (and similar) and resolve to // `/assets/icons/ANYPATH }
Inspired by
WICG
import maps proposal.