Selective maizzle build (one specific template only)
See original GitHub issueCommand maizzle watch
re-compiles only the one template that has been edited and saved, as to the documentation:
Also, if you’re editing a Template, Maizzle will only re-compile that Template, so changes are usually reflected in under a second. When making changes to files that have a global impact, like Layouts or Components, Maizzle will re-compile all Templates.
I would like to do similar file watching and selective compilation but applying the production config. Only command maizzle build [env]
allows specifying the configuration to be applied.
My use case is compiling the maizzle templates to a different templating system (Elixir / Phoenix app). So on each save of a Maizzle template the corresponding Phoenix template should be updated.
Today as a workaround an external filesystem watcher can be used, running a maizzle build [env]
when any file inside the maizzle folder is saved. But it is quite slow, as maizzle build
compiles all templates, not only the edited one.
I see 2 possibilities to improve the described use case:
maizzle build [env] template
accepts the name of a template to compile selectively.maizzle watch [env]
allows specifying a configuration to be applied on configuration.
Solution 2) would be better, as solution 1) pushes to the external filewatcher the complexity to classify if an edit/save was on a template or on global file, demanding recompilation of all templates. Ideal would be to allow solution 2) to even disable serving browsersync, understanding that the core of maizzle watch
is compilation, and serving is an optional add on, desired for some use cases.
Do you think expanding maizzle watch
with a configuration is viable and desired? Could I help to implement it?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Fixed, will work in the next release.
Ah right… The initial purpose of watching files was to be able to display them in a browser, that’s why we don’t do anything to the extension there. Now it would make sense to do it, thanks for bringing it up 👍