New course! Every coder should learn Generative AI!
Try a free lesson0
Webpack isn't just for React and in can do several things.
The key function is what you said: it bundles your modules (usually into a single JS file) ready to be served up.
Other than that, it can do things like watch for changes when you're developing to save you time - changes are reflected without you having to restart every time you change something.
It integrates with Babel to transpile your code.
It supports chunking to help performance - your JS is served in optimised chunks instead of a single file.
It supports tree shaking - where unused code is removed to help performance.
These are only some of the benefits.