nuxt-mjml-web
Browser-compatible mjml module for NuxtJS.
Installation
You can install nuxt-mjml-web
with your npm
client of choice.
$ npm install --save-dev nuxt-mjml-web
Usage
Add nuxt-mjml-web
to the buildModules
section of nuxt.config.js
.
buildModules: 'nuxt-mjml-web'
The module depends on mjml-web and takes care of isolating the bundle into its own chunk. It also prevents minification from breaking mjml component registration.
Keep in mind that the bundle isn't compatible with server-side rendering. You should only import mjml-web
in a client-only context. You can use dynamic imports to only load mjml when you need it.
const default: mjml2html registerComponent = await import'mjml-web'
License - MIT