* Processes the provided module. * @param {Module} module module to be rebuilt * @param {ModuleCallback} callback callback when module finishes rebuilding * @returns {void}
(module, callback)
| 2790 | * @returns {void} |
| 2791 | */ |
| 2792 | _rebuildModule(module, callback) { |
| 2793 | this.hooks.rebuildModule.call(module); |
| 2794 | const oldDependencies = [...module.dependencies]; |
| 2795 | const oldBlocks = [...module.blocks]; |
| 2796 | module.invalidateBuild(); |
| 2797 | this.buildQueue.invalidate(module); |
| 2798 | this.buildModule(module, (err) => { |
| 2799 | if (err) { |
| 2800 | return this.hooks.finishRebuildingModule.callAsync(module, (err2) => { |
| 2801 | if (err2) { |
| 2802 | callback( |
| 2803 | makeWebpackError(err2, "Compilation.hooks.finishRebuildingModule") |
| 2804 | ); |
| 2805 | return; |
| 2806 | } |
| 2807 | callback(err); |
| 2808 | }); |
| 2809 | } |
| 2810 | |
| 2811 | this.processDependenciesQueue.invalidate(module); |
| 2812 | this.moduleGraph.unfreeze(); |
| 2813 | this.processModuleDependencies(module, (err) => { |
| 2814 | if (err) return callback(err); |
| 2815 | this.removeReasonsOfDependencyBlock(module, { |
| 2816 | dependencies: oldDependencies, |
| 2817 | blocks: oldBlocks |
| 2818 | }); |
| 2819 | this.hooks.finishRebuildingModule.callAsync(module, (err2) => { |
| 2820 | if (err2) { |
| 2821 | callback( |
| 2822 | makeWebpackError(err2, "Compilation.hooks.finishRebuildingModule") |
| 2823 | ); |
| 2824 | return; |
| 2825 | } |
| 2826 | callback(null, module); |
| 2827 | }); |
| 2828 | }); |
| 2829 | }); |
| 2830 | } |
| 2831 | |
| 2832 | /** |
| 2833 | * Compute affected modules. |
nothing calls this directly
no test coverage detected