8

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.

soq
  • 181
  • 1
  • 6
  • Why not utilize webpack stats? https://webpack.js.org/configuration/stats/ – felixmosh Dec 24 '18 at 18:53
  • Because it can be received only after build, and I don't want to build. I want to get information if something changed to make decision, run build or not. – soq Dec 25 '18 at 05:16
  • do you need to know when some file is changed as [`fs.watch()`](https://nodejs.org/docs/latest/api/fs.html#fs_fs_watch_filename_options_listener) does? – skyboyer Dec 25 '18 at 10:11
  • No, I need to improve my deploy process like this: get some checksum of files, check if it changed (according to some saved checksum and bundles), and either run build or just get previously built bundles. – soq Dec 26 '18 at 06:33

1 Answers1

10

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

soq
  • 181
  • 1
  • 6