MCPcopy
hub / github.com/webpack/webpack / close

Method close

lib/Compiler.js:1465–1487  ·  view source on GitHub ↗

* Processes the provided error callback. * @param {ErrorCallback} callback signals when the compiler closes * @returns {void}

(callback)

Source from the content-addressed store, hash-verified

1463 * @returns {void}
1464 */
1465 close(callback) {
1466 if (this.watching) {
1467 // When there is still an active watching, close this first
1468 this.watching.close((_err) => {
1469 this.close(callback);
1470 });
1471 return;
1472 }
1473 this.hooks.shutdown.callAsync((err) => {
1474 if (err) return callback(err);
1475 // Defer a microtask so a close() made inside the run callback can't
1476 // release codeGenerationResults before afterDone fires on the same stack.
1477 const lastCompilation = this._lastCompilation;
1478 if (lastCompilation !== undefined) {
1479 Promise.resolve().then(() => {
1480 this._releaseUnusedCompilationData(lastCompilation);
1481 });
1482 }
1483 this._lastCompilation = undefined;
1484 this._lastNormalModuleFactory = undefined;
1485 this.cache.shutdown(callback);
1486 });
1487 }
1488
1489 /**
1490 * Schema validation function with optional pre-compiled check

Callers

nothing calls this directly

Calls 4

resolveMethod · 0.65
callbackFunction · 0.50
shutdownMethod · 0.45

Tested by

no test coverage detected