Why is Webpack called a "modular bundler"?
Webpack is called a "modular bundler" because it:
- Treats files as modules. Every file (JS, CSS, image, font, JSON) is treated by Webpack as a module with its own dependencies.
- Builds a dependency graph.
Webpack analyzes
importandrequirestatements, determines which modules depend on which, and builds a complete map of the project's connections. - "Bundles" - combines modules into output files. After analyzing dependencies, Webpack assembles everything into one or several bundles: optimized files ready for the browser to load.
In short: modules → dependency graph → one bundle (or several bundles). Hence the term modular bundler: a tool that bundles modules together.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.