Search code examples
javascriptwebpackwebpack-4webpack-pluginwebpack-loader

Is there a way to get dependency tree from webpack?


I have a big project with different types of dependencies in it: js, scss, svg, png, etc... My webpack is configured and bundles my code, I am happy with it.

But I want to get some kind of hash of all my dependencies (including binaries and all files formats). And what is most important: I do not want to build my code during this. For this purpose I need, for example, array of all files inside all of entry points or at least some kind of dependencies tree.

I tried to use compilation hook finishModules, but it completes after the compilation. Also tried some other hooks of compiler, don't remember which exactly.

I tried to write loader, but it seems like by default there is only source code of high-level files (like entry points themselves).

I'd be happy to receive some direction to move with my problem.


Solution

  • Seems like I can solve my problem using https://github.com/pahen/madge