Add Gulp to your MJML workflow!
Clone or download
iRyusa Merge pull request #38 from eseliger/master
fix(deps): fix dependencies and update mjml example file to v4
Latest commit 6eb5ef5 Aug 29, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples fix(deps): fis dependencies and update mjml file to v4 Jun 3, 2018
src Get rid of gulp-util, which is deprecated Mar 6, 2018
.gitignore Initial commit Jan 28, 2016
LICENSE Initial commit Jan 28, 2016
README.md Dealing with MJML compile options Jan 12, 2017
package.json Update package.json & lock Jun 20, 2018

README.md

Gulp MJML

Add Gulp to your MJML workflow!

Usage:

With an MJML file named test.mjml, render your emails to an html folder:

var gulp = require('gulp')
var mjml = require('gulp-mjml')

gulp.task('default', function () {
  return gulp.src('./test.mjml')
    .pipe(mjml())
    .pipe(gulp.dest('./html'))
})

If you have custom components linked to your own mjmlEngine, you can pass it to the gulp task so it uses your engine to render the html:

var gulp = require('gulp')
var mjml = require('gulp-mjml')

// Require your own components if needed, and your mjmlEngine (possibly with options)
// require('./components')
var mjmlEngine = require('mjml')

gulp.task('default', function () {
  return gulp.src('./test.mjml')
    .pipe(mjml(mjmlEngine, {minify: true}))
    .pipe(gulp.dest('./html'))
})