MCPcopy
hub / github.com/webpack/webpack / firstCssModulePostOrderIndex

Function firstCssModulePostOrderIndex

lib/dependencies/HtmlEntryDependency.js:304–318  ·  view source on GitHub ↗
(chunk, entrypoint, chunkGraph)

Source from the content-addressed store, hash-verified

302 * last among CSS chunks
303 */
304const 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

Callers 1

applyMethod · 0.85

Tested by

no test coverage detected