Mjml

MJML integration for Laravel Mix.
latest v1.0.4 - released 1 day ago
stidges
2 downloads last week
MIT license
5 versions
email
blade

Laravel Mix MJML

A Laravel Mix plugin to compile MJML files.

Installation

This package can be installed through NPM:

npm install -D laravel-mix-mjml

Basic Usage

// webpack.mix.js
const mix = require('laravel-mix');
require('laravel-mix-mjml');

mix.mjml();

API

The registered mjml plugin has the following signature:

mix.mjml(inputPath, outputPath, options);

inputPath

Type: String
Default: "resources/mail"

The path where the MJML files are located.

outputPath

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!

options.extension

Type: String
Default: ".blade.php"

The extension to use when outputting the compiled files.

options.*

Any other options are passed to the MJML compiler. Please review the MJML documetation which options are accepted here.

License

The MIT License (MIT). Please see License file for more information.