* Returns total size of the chunk. * @param {Chunk} chunk the chunk * @param {ChunkSizeOptions} options options object * @returns {number} total size of the chunk
(chunk, options = {})
| 995 | * @returns {number} total size of the chunk |
| 996 | */ |
| 997 | getChunkSize(chunk, options = {}) { |
| 998 | const cgc = this._getChunkGraphChunk(chunk); |
| 999 | const modulesSize = cgc.modules.getFromUnorderedCache(getModulesSize); |
| 1000 | const chunkOverhead = |
| 1001 | typeof options.chunkOverhead === "number" ? options.chunkOverhead : 10000; |
| 1002 | const entryChunkMultiplicator = |
| 1003 | typeof options.entryChunkMultiplicator === "number" |
| 1004 | ? options.entryChunkMultiplicator |
| 1005 | : 10; |
| 1006 | return ( |
| 1007 | chunkOverhead + |
| 1008 | modulesSize * (chunk.canBeInitial() ? entryChunkMultiplicator : 1) |
| 1009 | ); |
| 1010 | } |
| 1011 | |
| 1012 | /** |
| 1013 | * Gets integrated chunks size. |
no test coverage detected