Nimble_publisher and recompiling while running iex or mix

I have made a simple static site using nimble publisher and followed along with the tut from fly.io Crafting your own Static Site Generator using Phoenix · The Phoenix Files

That said I have a simular build() function as from in the tut that just simply compiles the markdown files using earmark and so on with heex and then writes the to a given dir via File.write!

I’ve noticed that if I start a iex session or even run a cowboy server that if I call said build function while in IEx that it will not write anything different from when it started.

If I call recompile after I’ve made a change to a .md file but before I run said build() then it works. I assume this is because the other markdown files are still in memory even though I’ve edited a file, until I recompile that new edit wont be in memory. This is my assumption.

All of that is a non issue when calling from a mix task in a separate terminal session and build can be recalled and works as expected. Only time I see an unexpected behavor is when running the command from in iex or from a genserver that was watching files.

My question is: Is this assumption correct and what can I do about it?