MCPcopy
hub / github.com/webpack/webpack / getOrderedChunkModulesIterableBySourceType

Method getOrderedChunkModulesIterableBySourceType

lib/ChunkGraph.js:785–793  ·  view source on GitHub ↗

* Gets ordered chunk modules iterable by source type. * @param {Chunk} chunk the chunk * @param {string} sourceType source type * @param {ModuleComparator} comparator comparator function * @returns {Iterable<Module> | undefined} return the modules for this chunk

(chunk, sourceType, comparator)

Source from the content-addressed store, hash-verified

783 * @returns {Iterable<Module> | undefined} return the modules for this chunk
784 */
785 getOrderedChunkModulesIterableBySourceType(chunk, sourceType, comparator) {
786 const cgc = this._getChunkGraphChunk(chunk);
787 const modulesWithSourceType = cgc.modules
788 .getFromUnorderedCache(cgc._modulesBySourceType)
789 .get(sourceType);
790 if (modulesWithSourceType === undefined) return;
791 modulesWithSourceType.sortWith(comparator);
792 return modulesWithSourceType;
793 }
794
795 /**
796 * Gets chunk modules.

Callers 7

generateMethod · 0.80
generateMethod · 0.80
renderChunkMethod · 0.80
renderMainMethod · 0.80
applyMethod · 0.80
applyMethod · 0.80

Calls 4

_getChunkGraphChunkMethod · 0.95
getFromUnorderedCacheMethod · 0.80
sortWithMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected