From f77eebcad4fe0a87dea26634084bb88b95eb1fcf Mon Sep 17 00:00:00 2001 From: JasonKleban Date: Wed, 6 Jan 2021 15:21:21 -0500 Subject: [PATCH] Fix DeprecationWarning: Chunk.forEachModule DeprecationWarning: Chunk.forEachModule: Use for(const module of chunk.modulesIterable) instead --- src/webpack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webpack.js b/src/webpack.js index 30f06812..ca398ac8 100644 --- a/src/webpack.js +++ b/src/webpack.js @@ -7,7 +7,7 @@ function buildManifest(compiler, compilation) { compilation.chunks.forEach(chunk => { chunk.files.forEach(file => { - chunk.forEachModule(module => { + for(const module of chunk.modulesIterable) { let id = module.id; let name = typeof module.libIdent === 'function' ? module.libIdent({ context }) : null; let publicPath = url.resolve(compilation.outputOptions.publicPath || '', file); @@ -21,7 +21,7 @@ function buildManifest(compiler, compilation) { } manifest[currentModule.rawRequest].push({ id, name, file, publicPath }); - }); + } }); });