Sha256: 21629f64a97112a8c9522f62373f7ec2b5fda81f584256d8a9dc5f3fb9f0b2a2
Contents?: true
Size: 982 Bytes
Versions: 7
Compression:
Stored size: 982 Bytes
Contents
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; class FlagIncludedChunksPlugin { apply(compiler) { compiler.plugin("compilation", (compilation) => { compilation.plugin("optimize-chunk-ids", (chunks) => { chunks.forEach((chunkA) => { chunks.forEach((chunkB) => { // as we iterate the same iterables twice // skip if we find ourselves if(chunkA === chunkB) return; // instead of swapping A and B just bail // as we loop twice the current A will be B and B then A if(chunkA.getNumberOfModules() < chunkB.getNumberOfModules()) return; if(chunkB.getNumberOfModules() === 0) return; // is chunkB in chunkA? for(const m of chunkB.modulesIterable) { if(!chunkA.containsModule(m)) return; } chunkA.ids.push(chunkB.id); }); }); }); }); } } module.exports = FlagIncludedChunksPlugin;
Version data entries
7 entries across 3 versions & 2 rubygems