MCPcopy Create free account
hub / github.com/jantimon/html-webpack-plugin / sortEntryChunks

Method sortEntryChunks

index.js:382–392  ·  view source on GitHub ↗

* Helper to sort chunks * * @private * @param {string[]} entryNames * @param {string|((entryNameA: string, entryNameB: string) => number)} sortMode * @param {Compilation} compilation

(entryNames, sortMode, compilation)

Source from the content-addressed store, hash-verified

380 * @param {Compilation} compilation
381 */
382 sortEntryChunks(entryNames, sortMode, compilation) {
383 // Custom function
384 if (typeof sortMode === "function") {
385 return entryNames.sort(sortMode);
386 }
387 // Check if the given sort mode is a valid chunkSorter sort mode
388 if (typeof chunkSorter[sortMode] !== "undefined") {
389 return chunkSorter[sortMode](entryNames, compilation, this.options);
390 }
391 throw new Error('"' + sortMode + '" is not a valid chunk sort mode');
392 }
393
394 /**
395 * Encode each path component using `encodeURIComponent` as files can contain characters

Callers 1

generateHTMLMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected