(chunk, entrypoint, chunkGraph)
| 302 | * last among CSS chunks |
| 303 | */ |
| 304 | const firstCssModulePostOrderIndex = (chunk, entrypoint, chunkGraph) => { |
| 305 | let min = Number.POSITIVE_INFINITY; |
| 306 | for (const sourceType of CSS_SOURCE_TYPES) { |
| 307 | const modules = chunkGraph.getChunkModulesIterableBySourceType( |
| 308 | chunk, |
| 309 | sourceType |
| 310 | ); |
| 311 | if (!modules) continue; |
| 312 | for (const module of modules) { |
| 313 | const idx = entrypoint.getModulePostOrderIndex(module); |
| 314 | if (idx !== undefined && idx < min) min = idx; |
| 315 | } |
| 316 | } |
| 317 | return min; |
| 318 | }; |
| 319 | |
| 320 | /** |
| 321 | * Build a fresh `<link rel="stylesheet" href="…">` for a CSS chunk that |
no test coverage detected