Vite plugin that compiles MJML templates to HTML (or other extension) files during dev and build. Version 0.4.0 is current, released 2024-01. Uses the popular mjml Node.js library under the hood. Key differentiator: integrates MJML compilation directly into Vite's pipeline, watches for changes in dev, and outputs to a configurable directory with custom extension (e.g., .blade.php). Alternatives require manual compilation or separate build steps. Release cadence: infrequent, last two versions were bug fixes.
npm install vite-plugin-mjmlVerified import paths — ran on the pinned version, not inferred.
Shows how to add the plugin to a Vite config with MJML input/output paths and custom output extension.
Upgrade to vite-plugin-mjml@^0.3.0 and use Vite ^3.0.
Rely on Vite's own logging for now.
Be selective with input glob patterns or use exclude option since v0.4.0.
npm install mjml --save-dev
Pass a single string path to the 'input' option.