()
| 1433 | } |
| 1434 | |
| 1435 | afterAllStored() { |
| 1436 | const packPromise = this.packPromise; |
| 1437 | if (packPromise === undefined) return Promise.resolve(); |
| 1438 | const reportProgress = ProgressPlugin.getReporter(this.compiler); |
| 1439 | return (this.storePromise = packPromise |
| 1440 | .then((pack) => { |
| 1441 | pack.stopCapturingRequests(); |
| 1442 | if (!pack.invalid) return; |
| 1443 | this.packPromise = undefined; |
| 1444 | this.logger.log(class="st">"Storing pack..."); |
| 1445 | /** @type {undefined | Promise<void>} */ |
| 1446 | let promise; |
| 1447 | /** @type {Set<string>} */ |
| 1448 | const newBuildDependencies = new Set(); |
| 1449 | for (const dep of this.newBuildDependencies) { |
| 1450 | if (!this.buildDependencies.has(dep)) { |
| 1451 | newBuildDependencies.add(dep); |
| 1452 | } |
| 1453 | } |
| 1454 | if (newBuildDependencies.size > 0 || !this.buildSnapshot) { |
| 1455 | if (reportProgress) reportProgress(0.5, class="st">"resolve build dependencies"); |
| 1456 | this.logger.debug( |
| 1457 | `Capturing build dependencies... (${[...newBuildDependencies].join(class="st">", ")})` |
| 1458 | ); |
| 1459 | promise = new Promise( |
| 1460 | /** |
| 1461 | * Handles the callback logic for this hook. |
| 1462 | * @param {(value?: undefined) => void} resolve resolve |
| 1463 | * @param {(reason?: Error) => void} reject reject |
| 1464 | */ |
| 1465 | (resolve, reject) => { |
| 1466 | this.logger.time(class="st">"resolve build dependencies"); |
| 1467 | this.fileSystemInfo.resolveBuildDependencies( |
| 1468 | this.context, |
| 1469 | newBuildDependencies, |
| 1470 | (err, result) => { |
| 1471 | this.logger.timeEnd(class="st">"resolve build dependencies"); |
| 1472 | if (err) return reject(err); |
| 1473 | |
| 1474 | this.logger.time(class="st">"snapshot build dependencies"); |
| 1475 | const { |
| 1476 | files, |
| 1477 | directories, |
| 1478 | missing, |
| 1479 | resolveResults, |
| 1480 | resolveDependencies |
| 1481 | } = /** @type {ResolveBuildDependenciesResult} */ (result); |
| 1482 | if (this.resolveResults) { |
| 1483 | for (const [key, value] of resolveResults) { |
| 1484 | this.resolveResults.set(key, value); |
| 1485 | } |
| 1486 | } else { |
| 1487 | this.resolveResults = resolveResults; |
| 1488 | } |
| 1489 | if (reportProgress) { |
| 1490 | reportProgress( |
| 1491 | 0.6, |
| 1492 | class="st">"snapshot build dependencies", |
no test coverage detected