Resolves the given import specifier with respect to the specified containing file path.
(specifier: string, containingFilePath: string)
| 95 | |
| 96 | /** Resolves the given import specifier with respect to the specified containing file path. */ |
| 97 | private _resolveImport(specifier: string, containingFilePath: string): string | null { |
| 98 | if (specifier.charAt(0) === '.') { |
| 99 | const resolvedPath = this._resolveFileSpecifier(specifier, containingFilePath); |
| 100 | if (resolvedPath === null) { |
| 101 | this._trackUnresolvedFileImport(specifier, containingFilePath); |
| 102 | } |
| 103 | return resolvedPath; |
| 104 | } |
| 105 | if (this.resolveModuleFn) { |
| 106 | const targetFile = this.resolveModuleFn(specifier); |
| 107 | if (targetFile !== null) { |
| 108 | const resolvedPath = this._resolveFileSpecifier(targetFile); |
| 109 | if (resolvedPath !== null) { |
| 110 | return resolvedPath; |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | this.unresolvedModules.add(specifier); |
| 115 | return null; |
| 116 | } |
| 117 | |
| 118 | /** Tracks the given file import as unresolved. */ |
| 119 | private _trackUnresolvedFileImport(specifier: string, originFilePath: string) { |
no test coverage detected