I am the maintainer of external-svg-sprite-loader and I noticed that when using it with webpack 5 I get the following warning:
[DEP_WEBPACK_CHUNK_MODULES_ITERABLE] DeprecationWarning: Chunk.modulesIterable: Use new ChunkGraph API
The build passes but I would like to able to fix this deprecation warning. However, I can't find any documentation about modulesIterable
or the ChunkGraph API. Where should I look for it and what would be a potential solution for this issue?
I had this issue because I was using compilation.hooks.optimizeChunks to iterate through all modules in the compilation. After some research, I found that I could use compilation.hooks.optimizeModules to achieve the same result. Therefore, I switched to the latter and stopped getting the deprecation warning mentioned in my question. I would say that this is a better solution than iterating through the modules in a chunk since webpack seems to already be doing that internally anyway.