
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Add MJML to your gulp workflow!
With an MJML file named
test.mjml
, render your emails to an html folder:
const gulp = require('gulp')
const 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:
const gulp = require('gulp')
const mjml = require('gulp-mjml')
// Require your own components if needed, and your mjmlEngine (possibly with options)
// require('./components')
const mjmlEngine = require('mjml')
gulp.task('default', function () {
return gulp.src('./test.mjml')
.pipe(mjml(mjmlEngine, {minify: true}))
.pipe(gulp.dest('./html'))
})
If you'd like to get validation errors and , use
strict
and a custom error handler function. Note that usingstrict
will not render the file in case of error:
const gulp = require('gulp')
const mjml = require('gulp-mjml')
const mjmlEngine = require('mjml')
function handleError (err) {
console.log(err.toString());
this.emit('end');
}
gulp.task('default', function () {
return gulp.src('./test.mjml')
.pipe(mjml(mjmlEngine, {validationLevel: 'strict'}))
.on('error', handleError)
.pipe(gulp.dest('./html'))
})
FAQs
Add Gulp to your MJML workflow
The npm package gulp-mjml receives a total of 2,584 weekly downloads. As such, gulp-mjml popularity was classified as popular.
We found that gulp-mjml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.