On this page

compareChunkGroupsByIndex(a, b): 0 | 1 | -1
Attributes
first chunk group
second chunk group
Returns:0 | 1 | -1
compare result

Compares chunk groups by index.


Compares the provided values and returns their ordering.


compareChunksById(a, b): 0 | 1 | -1
Attributes
chunk
chunk
Returns:0 | 1 | -1
compare result

Returns compare result.


compareChunksNatural(chunkGraph): Comparator<Chunk>
Attributes
chunkGraph:ChunkGraph
the chunk graph
Returns:Comparator<Chunk>
comparator

Compares chunks natural.


compareIds(a, b): 0 | 1 | -1
Attributes
first id
second id
Returns:0 | 1 | -1
compare result

Compares the provided values and returns their ordering.


compareIterables(elementComparator): Comparator<Iterable<T>>
Attributes
elementComparator:Comparator<T>
comparator for elements
Returns:Comparator<Iterable<T>>
comparator for iterables of elements

Compares iterables.


compareLocations(a, b): 0 | 1 | -1
Attributes
A location node
A location node
Returns:0 | 1 | -1
sorting comparator value

Compare two locations


Compare modules by their full name. This differs from comparing by identifier in that the values have been normalized to be relative to the compiler context.


Compares modules by id.


compareModulesByIdentifier(a, b): 0 | 1 | -1
Attributes
module
module
Returns:0 | 1 | -1
compare result

Returns compare result.


Compares modules by id or identifier.


Compares modules by post order index or identifier.


Compares modules by pre order index or identifier.


compareNumbers(a, b): 0 | 1 | -1
Attributes
number
number
Returns:0 | 1 | -1
compare result

Compares the provided values and returns their ordering.


compareSelect(getter, comparator): Comparator<T>
Attributes
getter:Selector<T, R>
getter for value
comparator:Comparator<R>
comparator
Returns:Comparator<T>
comparator

Compares the provided values and returns their ordering.


compareStrings(a, b): 0 | 1 | -1
Attributes
first string
second string
Returns:0 | 1 | -1
compare result

Compares the provided values and returns their ordering.


compareStringsNumeric(a, b): 0 | 1 | -1
Attributes
string
string
Returns:0 | 1 | -1
compare result

Compares strings numeric.


concatComparators(c1, c2, ...cRest?): Comparator<T>
Attributes
comparator
comparator
cRest:Comparator<T>[]
comparators
Returns:Comparator<T>
comparator

Concat comparators.


keepOriginalOrder(iterable): Comparator<T>
Attributes
iterable:Iterable<T>
original ordered list
Returns:Comparator<T>
comparator

Keep original order.


sortWithSourceOrder(dependencies, dependencySourceOrderMap, onDependencyReSort?): void
Attributes
dependencies:Dependency[]
dependencies
dependencySourceOrderMap:WeakMap<Dependency, DependencySourceOrder>
dependency source order map
onDependencyReSort:(dep: Dependency, index: number) => void
optional callback to set index for each dependency
Returns:void

For HarmonyImportSideEffectDependency and HarmonyImportSpecifierDependency, we should prioritize import order to match the behavior of running modules directly in a JS engine without a bundler. For other types like ConstDependency, we can instead prioritize usage order. https://github.com/webpack/webpack/pull/19686


Attributes
a:T
b:T
Returns:-1 | 0 | 1

Creates a cached parameterized comparator.

Attributes
main:number
the main source order
sub:number
the sub source order

Attributes
tArg:TArg
Returns:Comparator<T>

Attributes
input:A
Returns:B | null | undefined