Understanding the Compilation and Linking Process in PXT-Microbit MakeCode: From Blocks to Hex File

each project has a pxt.json file which has a files array that specifies which files to include. dependencies also have a pxt.json file with the same property. the files that are included in the project are the combination of the project files and all files from referenced dependencies

Alright, got this point @richard now just, i want further clarifications on the following point:
now what i want to know is :

  1. Which exactly pxt.json are you talking about, like from the code base or the one which we see on the right side under the explorer section
  2. Where the pxt.json is exactly passed or called
  3. any possible way i can view the hex-file being stored in the browser cache before we hit the download button

answers:

  1. yes the one in the file explorer
  2. do you mean where in the makecode codebase?
  3. no, we don’t really surface any way to get the empty hex file out of the browser

i feel like we’re going to keep talking in circles unless you give me a clearer picture of what your end goal is here. do you have a new board you’re trying to host a makecode editor for? what product are you targeting (e.g. a robot, an education board, something else)? are you planning on forking makecode?

i can understand that @richard, and also thought the same.. so here’s the clearer picture of my end goal:
to be precised as discussed above **i am trying to replicate the exactly same thing **
for imx8-ulp board from NXP. So that it would be basically useful for developing the different
embedded projects for our own system. That would include developing the different
sort of projects which would also include robotics. Thus currently i am trying to understand
in depth about the exact process behind the magic, that is taking place when we move
the blocks and it compiles and generates the hex-file. Once i have a more broader and
clearer picture, then it would be easy for me to replicate this exact same thing

And yes, in context to answer your question,i meant where in the makecode codebase…

hi @richard , While exploring code, I have found the code is residing in pxt.js file. Can you please point out who is generating this file and which function or file is responsible to convert Block code (main.ts) to hex file for Microbit? I would like to add a custom code changes in this routine to convert typescript to C / C++. Appreciate your help and support.