0

When using the WebPack Loader API, does this.addDependency also add the file to the bundle?

Resist Design
  • 4,462
  • 3
  • 22
  • 35

1 Answers1

0

No, it only add this file as a dependency of the file that is loaded via the loader. That means that each change in the dependent file, webpack will re-build the module that the dependency was added to.

This is like a "watch" on the dependent file.

felixmosh
  • 32,615
  • 9
  • 69
  • 88
  • When you say "module", do you mean the file that was passed into the loader? Or something else (e.g every file that the loader loads or something similar). – Foobar Jun 24 '20 at 01:41
  • Module is a webpack terminology, it is the file that passed to the loader. – felixmosh Jun 24 '20 at 04:07