Open aaronjensen opened 7 years ago
It's apparently not this simple. This works/helps for changes in existing templates as far as I can tell but it does not work when you add a new template.
Phoenix has this problem too and the way they solve it is somewhat involved.
The view modules export __phoenix_recompile__?/0
which is checked by a mix task that touches the file if it says yes before compilation.
@external_resource
is used already. Indeed it might not detect new files. Good to figure out how phoenix does it and implement it as well. A way to resolve it when switching branches etc. is running mix clean
.
Right now, if a built template changes w/o running smoothie.compile (as it may if you were to check out a different branch that had a new template), the templates module will not be rebuilt and you may get compile errors.
I believe the proper thing for smoothie to do is to declare its dependency upon external files like the built templates.
Right now I'm working around this like this in my module that has
use Smoothie