MCPcopy
hub / github.com/webpack/webpack / hasAsyncChunks

Method hasAsyncChunks

lib/Chunk.js:761–787  ·  view source on GitHub ↗

* Checks whether this chunk has async chunks. * @returns {boolean} true, if the chunk references async chunks

()

Source from the content-addressed store, hash-verified

759 * @returns {boolean} true, if the chunk references async chunks
760 */
761 hasAsyncChunks() {
762 /** @type {Queue} */
763 const queue = new Set();
764
765 const initialChunks = intersect(
766 Array.from(this.groupsIterable, (g) => new Set(g.chunks))
767 );
768
769 for (const chunkGroup of this.groupsIterable) {
770 for (const child of chunkGroup.childrenIterable) {
771 queue.add(child);
772 }
773 }
774
775 for (const chunkGroup of queue) {
776 for (const chunk of chunkGroup.chunks) {
777 if (!initialChunks.has(chunk)) {
778 return true;
779 }
780 }
781 for (const child of chunkGroup.childrenIterable) {
782 queue.add(child);
783 }
784 }
785
786 return false;
787 }
788
789 /**
790 * Gets child ids by orders.

Callers 1

applyMethod · 0.80

Calls 3

intersectFunction · 0.85
addMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected