| | |
| | | /** @typedef {import("./ModuleGraph")} ModuleGraph */ |
| | | |
| | | /** |
| | | * Sorts the conflicting modules by identifier to keep warning output stable. |
| | | * @param {Module[]} modules the modules to be sorted |
| | | * @returns {Module[]} sorted version of original modules |
| | | */ |
| | |
| | | }); |
| | | |
| | | /** |
| | | * Formats the conflicting modules and one representative incoming reason for |
| | | * each module into the warning body. |
| | | * @param {Module[]} modules each module from throw |
| | | * @param {ModuleGraph} moduleGraph the module graph |
| | | * @returns {string} each message from provided modules |
| | |
| | | }) |
| | | .join("\n"); |
| | | |
| | | /** |
| | | * Warning emitted when webpack finds modules whose identifiers differ only by |
| | | * letter casing, which can behave inconsistently across filesystems. |
| | | */ |
| | | class CaseSensitiveModulesWarning extends WebpackError { |
| | | /** |
| | | * Creates an instance of CaseSensitiveModulesWarning. |
| | | * Builds a warning message that lists the case-conflicting modules and |
| | | * representative importers that caused them to be included. |
| | | * @param {Iterable<Module>} modules modules that were detected |
| | | * @param {ModuleGraph} moduleGraph the module graph |
| | | */ |
| | |
| | | Use equal casing. Compare these module identifiers: |
| | | ${modulesList}`); |
| | | |
| | | /** @type {string} */ |
| | | this.name = "CaseSensitiveModulesWarning"; |
| | | this.module = sortedModules[0]; |
| | | } |