question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Selective maizzle build (one specific template only)

See original GitHub issue

Command 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:

  1. maizzle build [env] template accepts the name of a template to compile selectively.
  2. 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:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cossssmincommented, Apr 16, 2021

Fixed, will work in the next release.

1reaction
cossssmincommented, Mar 24, 2021

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 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build process | Maizzle
When you run maizzle build , your templates go through a series of events that compile them to plain HTML and apply various,...
Read more >
Creating e-mails with Maizzle - Cauê Almeida - Medium
Maizzle is a framework that helps you quickly build HTML emails with. Tailwind CSS and advanced, email-specific post-processing.
Read more >
Possible to have multiple target build directories? #207 - GitHub
I am just trying maizzle to see if it will save me time (moving over from mjml templates, I'm also a fan of...
Read more >
The Top Email Frameworks for DIY Development
It's just a collection of well-designed responsive HTML email templates. If you're not looking to create especially complex emails, Cerberus may ...
Read more >
Maizzle.js (@maizzlejs) / Twitter
I can do this) option The middle ground (and the topic of this thread) is to use a starter template and TailwindCSS to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found