A Laravel Mix plugin to compile MJML files.
This package can be installed through NPM:
npm install -D laravel-mix-mjml
Please review the features and breaking changes documented in the release notes.
// webpack.mix.js
const mix = require('laravel-mix');
require('laravel-mix-mjml');
mix.mjml();
The registered mjml
plugin has the following signature:
mix.mjml(entry, output[, options]);
Type: String
Default: "resources/mail"
The path where the MJML files are located. Can be a path to a specific file, a path to a directory, or a glob string.
Type: String
Default: "resources/views/mail"
The path where the compiled files should be outputted to. Note: This path will be resolved relative to your root path!
Type: String
Default: ".blade.php"
The extension to use when outputting the compiled files. Ignored if a specific file path is passed as the output path.
Type: Object
Default:
{
minify: false,
beautify: true,
filePath: '/path/to/input/file',
}
The options to pass to the MJML compiler. Please review the MJML documetation which options are accepted here.
The MIT License (MIT). Please see License file for more information.