How did the webpack load on the browser

  node.js, question

Recently, I am looking at the related knowledge of webpack and want to apply it to the project. The original project used requirejs, which belongs to amd and is an asynchronous loading module. My understanding of AMD is that the browser loads the compiler (requirejs) and then loads other modules according to the dependency. This process is completed on the browser. As for asynchrony, it refers to that the script refers to requirejs. Other scripts can be written below. Js files introduced below may load faster than the above files. As for webpack, js files are packaged on the server side (locally) according to the dependency. That is to say, the dependent processing work is put on the server side. Finally, it can be directly introduced on js. I don’t know if this is my understanding, right? In addition, I saw that the webpack is compatible with AMD, but is it synchronous or asynchronous in the browser itself? I hope to communicate with you and deepen our understanding.

The webpack I understand is like this. After it is packaged, it actually generates an ordinary js file. It is not as spicy or magical as you think.

The principle of its modularization is probably as follows:

var a = {};
 
 (function(a){
 //Module 1
 a.module1 = '';
 })(a);
 
 (function(a){
 //Introduction Module 1
 var module1 = a.module1;
 
 //Module 2
 a.module2 = '';
 })(a);