I'm using Handlebars to generate HTML for emails in a NodeJS environment. Since I'm generating emails, I'm inlining my styles.
My flow currently looks like this:
- Read Handlebars template file and compile into function
- Execute Handlebars function to get HTML
- Run CSS inliner over HTML
- Send email
I'd like to perform as much of this at build time. I know I can pre-compile my Handlebars templates to Javascript. Is there a way I can also do CSS inlining at build time?
Ideally my flow would be:
- Build time: Pre-compile Handlebars templates & inline CSS into JS
- Execute pre-compiled Handlebars function to get HTML
- Send email