The main purpose of Webpack is to prepare your JavaScript files so that they can be consumed by the browser. It does so by scanning your JavaScript code from an entry point (usually the index.js file) and then following the import statements that are written in that entry point.
Full article