* Returns context hash. * @param {string} path context path * @param {(err?: WebpackError | null, contextHash?: string) => void} callback callback function * @returns {void}
(path, callback)
| 1733 | * @returns {void} |
| 1734 | */ |
| 1735 | getContextHash(path, callback) { |
| 1736 | const cache = this._contextHashes.get(path); |
| 1737 | if (cache !== undefined) { |
| 1738 | const resolved = getResolvedHash(cache); |
| 1739 | if (resolved !== undefined) { |
| 1740 | return callback(null, /** @type {string} */ (resolved)); |
| 1741 | } |
| 1742 | return this._resolveContextHash(cache, callback); |
| 1743 | } |
| 1744 | this.contextHashQueue.add(path, (err, _entry) => { |
| 1745 | if (err) return callback(err); |
| 1746 | const entry = /** @type {ContextHash} */ (_entry); |
| 1747 | const resolved = getResolvedHash(entry); |
| 1748 | if (resolved !== undefined) { |
| 1749 | return callback(null, /** @type {string} */ (resolved)); |
| 1750 | } |
| 1751 | this._resolveContextHash(entry, callback); |
| 1752 | }); |
| 1753 | } |
| 1754 | |
| 1755 | /** |
| 1756 | * Get unresolved context hash. |
no test coverage detected