@dougthwaites/laravel-mix-mjml

3.0.1 • Public • Published

All credits go to @stidges. This fork add file watching and apart from that is the same as tidges/laravel-mix-mjml v3.0.0

Laravel Mix MJML

tests

A Laravel Mix plugin to compile MJML files.

Installation

This package can be installed through NPM:

npm install -D laravel-mix-mjml

Upgrading to v2.0.0

Please review the features and breaking changes documented in the release notes.

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(entry, output[, options]);

entry

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.

output

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. Ignored if a specific file path is passed as the output path.

options.mjmlOptions

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.

License

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

/@dougthwaites/laravel-mix-mjml/

    Package Sidebar

    Install

    npm i @dougthwaites/laravel-mix-mjml

    Weekly Downloads

    1

    Version

    3.0.1

    License

    MIT

    Unpacked Size

    11 kB

    Total Files

    12

    Last publish

    Collaborators

    • dougthwaites