Open brigadier opened 9 years ago
We can do a recompile of all templates if one changed. Does that sound good? Looking inside templates is the road to madness, though.
No, don't think it's good to recompile everything,
Then I am open to suggestion for a solution. Parsing all files is not a very good idea I think, because if you're going to parse everything you might as well just recompile everything.
Sure, parsing doesn't look so good too. I've opened the issue mainly to have it tracked, not for immediate solution.
I think I will add a recompile of all templates when one has changed, that should be better than the current behavior anyway.
I think we can do without parsing all files. We only need to detect includes and base templates and make a set of dependency rules to recompile everything needed, the same way erlc -M does.
Django templates can be dependent on other templates with
{% include %}
and{% extends %}
tags. Erlydtl compiles such templates as monolithic one, it won't call one template from another. As erlang.mk depends on file change timestamps, such templates don't get recompiled.As a workaround I do
touch ./templates/* && make app
, but it would be nicer to have a builtin detection of inheritance and dependency.