How do AMD loaders work under the hood?
问题 So I've been using require.js for while now, but I realized that I actually don't know how it works under the hood. It says that it's an AMD loader. I do understand that CommonJS is synchronous, which means that it blocks execution of other codes while it's being loaded. On the other hand, AMD is asynchronous. This is where I get confused. When I define a module, it has to load a,b,c in order to execute the callback. How does asynchronous work here? Isn't it synchronous when it has to load