Skip to content

Commit

Permalink
make the cache a WeakMap to not leak memory
Browse files Browse the repository at this point in the history
fixes #6929
  • Loading branch information
sokra committed Jul 5, 2018
1 parent bdd4442 commit 64b22c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/optimize/SplitChunksPlugin.js
Expand Up @@ -135,7 +135,8 @@ module.exports = class SplitChunksPlugin {

static normalizeName({ name, automaticNameDelimiter }) {
if (name === true) {
const cache = new Map();
/** @type {WeakMap<Chunk[], Record<string, string>>} */
const cache = new WeakMap();
const fn = (module, chunks, cacheGroup) => {
let cacheEntry = cache.get(chunks);
if (cacheEntry === undefined) {
Expand Down

0 comments on commit 64b22c4

Please sign in to comment.