MCPcopy
hub / github.com/webpack/webpack / canChunksBeIntegrated

Method canChunksBeIntegrated

lib/ChunkGraph.js:1046–1072  ·  view source on GitHub ↗

* Checks whether it can chunks be integrated. * @param {Chunk} chunkA chunk * @param {Chunk} chunkB chunk * @returns {boolean} true, if chunks could be integrated

(chunkA, chunkB)

Source from the content-addressed store, hash-verified

1044 * @returns {boolean} true, if chunks could be integrated
1045 */
1046 canChunksBeIntegrated(chunkA, chunkB) {
1047 if (chunkA.preventIntegration || chunkB.preventIntegration) {
1048 return false;
1049 }
1050
1051 const hasRuntimeA = chunkA.hasRuntime();
1052 const hasRuntimeB = chunkB.hasRuntime();
1053
1054 if (hasRuntimeA !== hasRuntimeB) {
1055 if (hasRuntimeA) {
1056 return isAvailableChunk(chunkA, chunkB);
1057 } else if (hasRuntimeB) {
1058 return isAvailableChunk(chunkB, chunkA);
1059 }
1060
1061 return false;
1062 }
1063
1064 if (
1065 this.getNumberOfEntryModules(chunkA) > 0 ||
1066 this.getNumberOfEntryModules(chunkB) > 0
1067 ) {
1068 return false;
1069 }
1070
1071 return true;
1072 }
1073
1074 /**
1075 * Processes the provided chunk a.

Callers 6

integrateMethod · 0.80
canBeIntegratedMethod · 0.80
applyMethod · 0.80
applyMethod · 0.80
applyMethod · 0.80
applyMethod · 0.80

Calls 3

isAvailableChunkFunction · 0.85
hasRuntimeMethod · 0.80

Tested by

no test coverage detected