Constructor
new Resolver(options)
Parameters:
- Source:
Members
cache :Map:.<string:, string:>
Type:
- Source:
manifests :Map:.<string:, (object:|null:)>
Type:
- Source:
roots :Array:.<string:>
Type:
- Source:
runtimeEntry :string
Type:
- string
- Source:
virtualModules :Map:.<string:, string:>
Type:
- Source:
Methods
isVirtual(id) → {boolean}
Whether an id names a module the compiler generated rather than a file.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | The module id. |
- Source:
Returns:
True for a virtual module.
- Type
- boolean
resolve(specifier, importer) → {string}
Resolves a specifier to a module id.
Parameters:
| Name | Type | Description |
|---|---|---|
specifier |
string | The import specifier as written. |
importer |
string | Absolute path or virtual id of the importing module. |
- Source:
Throws:
-
When the specifier names nothing resolvable.
- Type
- ResolveError
Returns:
The resolved module id.
- Type
- string