code: function extractModulesAndReturnAffectedChunks(reallyUsedModules, usedChunks) {
    const affectedChunksSet = new Set()
    reallyUsedModules.forEach(
      module => usedChunks.forEach(
        // removeChunk returns true if the chunk was contained and succesfully removed
        // false if the module did not have a connection to the chunk in question
        chunk => module.removeChunk(chunk) && affectedChunksSet.add(chunk)
      )
    )
    return affectedChunksSet
  }
docs: methods similar to CommonsChunkPlugin internals: