Clarification on Build Process and Firmware Generation in PXT MakeCode

Hello,

While exploring the PXT MakeCode codebase in depth, I observed a few behaviors that I would like to clarify:

I attempted to build the pxt folder using sudo npm run build with my internet connection turned off. During this process, I noticed that the editor would continuously load without rendering properly on my localhost. However, after rebuilding the pxt folder with the internet connection enabled, the build completed successfully, and I was able to deploy and use the editor locally—even with the Wi-Fi turned off afterward.

This led me to the following questions:

File Inclusion during Build:
How can I determine which exact C++ files are being included during the build process? I'm particularly interested in understanding how block arrangements translate into compiled firmware code.

Firmware Generation:
How is the hex file being generated even when the editor is deployed locally without an internet connection? Is this process entirely local after the initial setup?

Role of Docker/Yotta:
While exploring further, I noticed references to Docker containers being used for certain builds. Should I assume that the Yotta build environment is encapsulated within the Docker image pext/yotta:gcc5?

Any clarification on these points would be greatly appreciated. I'm trying to gain a deeper understanding of how the MakeCode platform handles its build pipeline and firmware generation