diff --git a/README.md b/README.md index ce4e4ad..725be9b 100644 --- a/README.md +++ b/README.md @@ -55,3 +55,18 @@ gulp.task('default', function () { .pipe(gulp.dest('./html')) }) ``` + +> If you want to override the default file extension that is output use `fileExt` + +```javascript +const gulp = require('gulp') +const mjml = require('gulp-mjml') + +const mjmlEngine = require('mjml') + +gulp.task('default', function () { + return gulp.src('./test.mjml') + .pipe(mjml(mjmlEngine, {minify: true, fileExt: ".txt"})) + .pipe(gulp.dest('./html')) +}) +``` \ No newline at end of file diff --git a/src/index.js b/src/index.js index 4a82bfa..c1671e1 100644 --- a/src/index.js +++ b/src/index.js @@ -47,7 +47,7 @@ module.exports = function mjml(mjmlEngine, options) { // [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues output.contents = Buffer.from(render.html); - output.path = replaceExt(file.path.toString(), ".html"); + output.path = replaceExt(file.path.toString(), localOptions.fileExt || ".html"); this.push(output); } return callback();