Closed fzembow closed 7 years ago
Hi !
Thanks for reporting it @fzembow ! I'll take a look if we can do a quick fix about this
Could this be as simple as parsing through the input file that gets passed to the watch command and checking for any mj-include tags, and if so, add additional watches for those files, which trigger a render on the original input?
Just started using mjml today, so I'm super unfamiliar with things, but I ran into this problem as I'm using includes for global elements.
That's what I tried, but the main issue is, if you'll add some mj include during the recompile you have to check those new files too.
You have to check everytime if there's some new include, or include that doesn't exist anymore and the watch API from nodeJS isn't really designed with that in mind
Hmmmm... Gotcha. That makes sense. The trade-off between getting something up there that helps, but is not the right long-term solution, vs waiting for the perfect solution is real. I can understand why it's not an easy fix. Alright, hopefully I can have some time to take a deeper look at some point.
Hi @thepuzzlemaster @fzembow
Quick update here, we're about to release this in 3.2 ! A beta should be released this week, so feel free to give a try :)
STEPS
<mj-include>
s in itmjml -w the_original_file.mjml
ACTUAL
EXPECTED
NOTE
mj-include
works, at least to create a dependency graph between files to know when the watched file needs to be re-rendered.MJML is fantastic by the way, especially when combining mj-include with mj-attributes, now we have something close to sharable styles for a huge library of emails :)