* Checks whether the module needs to be rebuilt for the current build state. * @param {NeedBuildContext} context context info * @param {NeedBuildCallback} callback callback function, returns true, if the module needs a rebuild * @returns {void}
({ fileSystemInfo }, callback)
| 449 | * @returns {void} |
| 450 | */ |
| 451 | needBuild({ fileSystemInfo }, callback) { |
| 452 | class="cm">// build if enforced |
| 453 | if (this._forceBuild) return callback(null, true); |
| 454 | |
| 455 | const buildInfo = /** @type {ContextModuleBuildInfo} */ (this.buildInfo); |
| 456 | |
| 457 | class="cm">// always build when we have no snapshot and context |
| 458 | if (!buildInfo.snapshot) { |
| 459 | return callback(null, Boolean(this.context || this.options.resource)); |
| 460 | } |
| 461 | |
| 462 | fileSystemInfo.checkSnapshotValid(buildInfo.snapshot, (err, valid) => { |
| 463 | callback(err, !valid); |
| 464 | }); |
| 465 | } |
| 466 | |
| 467 | /** |
| 468 | * Builds the module using the provided compilation context. |
nothing calls this directly
no test coverage detected