WXL
3 天以前 3bd962a6d7f61239c020e2dbbeb7341e5b842dd1
node_modules/webpack/lib/CaseSensitiveModulesWarning.js
@@ -11,6 +11,7 @@
/** @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
 */
@@ -27,6 +28,8 @@
   });
/**
 * 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
@@ -49,9 +52,14 @@
      })
      .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
    */
@@ -63,6 +71,7 @@
Use equal casing. Compare these module identifiers:
${modulesList}`);
      /** @type {string} */
      this.name = "CaseSensitiveModulesWarning";
      this.module = sortedModules[0];
   }