For my own little proof of concept with LiveView single-file components I do the following:
- read file contents
- generate module source. In this case I’m literally building a string of the source, but it can be done with creative uses of
quote do(though I don’t have an example at the moment) - call
Code.compile_quoted
This way you can compile everything on start (provided you start your compiler beforehand)
Another option (if you don’t want to monitor files and only compile them on startup) is to create a mix compiler task and add it to compiler list. Mix task, and config






















