* Checks whether this module is optional. * @param {ModuleGraph} moduleGraph the module graph * @returns {boolean} true, if the module is optional
(moduleGraph)
| 829 | * @returns {boolean} true, if the module is optional |
| 830 | */ |
| 831 | isOptional(moduleGraph) { |
| 832 | let hasConnections = false; |
| 833 | for (const r of moduleGraph.getIncomingConnections(this)) { |
| 834 | if ( |
| 835 | !r.dependency || |
| 836 | !r.dependency.optional || |
| 837 | !r.isTargetActive(undefined) |
| 838 | ) { |
| 839 | return false; |
| 840 | } |
| 841 | hasConnections = true; |
| 842 | } |
| 843 | return hasConnections; |
| 844 | } |
| 845 | |
| 846 | /** |
| 847 | * Checks whether this module is accessible in chunk. |
no test coverage detected