Skip to content

v2.0.0

Compare
Choose a tag to compare
@stidges stidges released this 28 Oct 13:43
· 23 commits to master since this release
v2.0.0
472d88f

v2.0.0 introduces more flexibility for specifying the input paths and moves the MJML compiler options to a dedicated mjmlOptions entry in the options argument.

New features and improvements

  1. Input path improvements
    The input path now supports globs and specific input filenames. Previously it only supported a directory name and always performed a recursive glob to grab the files.
  2. Multiple entry support
    The .mjml() plugin can now be called multiple times with different input paths, output paths and options.
  3. Better default filePath value
    MJML uses a filePath option to resolve the paths used in mj-include directives. Previously this defaulted to the root directory of your project, but has now been updated to the input path to support relative file inclusion.

Breaking changes

  1. New mjmlOptions entry in options argument.
    This MJML compiler options have been moved into a dedicated mjmlOptions entry.
// before
mix.mjml('resources/mail', 'resources/views/mail', {
  extension: '.html',
  beautify: false,
  minify: true,
});

// after
mix.mjml('resources/mail', 'resources/views/mail', {
  extension: '.html',
  mjmlOptions: {
    beautify: false,
    minify: true,
  },
});
  1. New default filePath value
    In previous versions, using the mj-include directive required you to specify the full path to the partial to include. While this could be overridden through the options argument, the default for this has been improved to allow easier relative file inclusion. If you are overriding the filePath option no changes have to be made:
<!-- before -->
<mj-include path="resources/mail/includes/include.mjml" />

<!-- after -->
<mj-include path="./includes/include.mjml" />