WXL
3 天以前 9bce51f651aad297ef9eb6df832bfdaf1de05d84
node_modules/webpack/lib/optimize/FlagIncludedChunksPlugin.js
@@ -16,7 +16,7 @@
class FlagIncludedChunksPlugin {
   /**
    * Apply the plugin
    * Applies the plugin by registering its hooks on the compiler.
    * @param {Compiler} compiler the compiler instance
    * @returns {void}
    */
@@ -42,7 +42,17 @@
            // precalculate the modulo values for each bit
            const modulo = 1 / (1 / modulesCount) ** (1 / 31);
            const modulos = Array.from({ length: 31 }, (x, i) => (modulo ** i) | 0);
            /** @type {number[]} */
            const modulos = Array.from(
               { length: 31 },
               /**
                * Handles the callback logic for this hook.
                * @param {number} x x
                * @param {number} i i
                * @returns {number} result
                */
               (x, i) => (modulo ** i) | 0
            );
            // iterate all modules to generate bit values
            let i = 0;
@@ -72,6 +82,7 @@
                  (chunkModulesHash.get(chunkA));
               const chunkAModulesCount = chunkGraph.getNumberOfChunkModules(chunkA);
               if (chunkAModulesCount === 0) continue;
               /** @type {undefined | Module} */
               let bestModule;
               for (const module of chunkGraph.getChunkModulesIterable(chunkA)) {
                  if (