gulp-markoc

1.0.1 • Public • Published

gulp-markoc

npm

Compile Marko templates as part of your Gulp build process.

Usage

var marko = require('gulp-markoc');
 
gulp.task('marko', function() {
  gulp.src('./src/*.marko')
    .pipe(marko({preserveWhitespace: true}).on('error', gutil.log))
    .pipe(gulp.dest('./public/'))
});

Error handling

gulp-markoc will emit an error for cases such as invalid Marko syntax. If uncaught, the error will crash gulp.

You will need to attach a listener (i.e. .on('error')) for the error event emitted by gulp-markoc:

var markoStream = marko({preserveWhitespace: true});
 
// Attach listener
markoStream.on('error', function(err) {});

In addition, you may utilize gulp-util's logging function:

var gutil = require('gulp-util');
 
gulp.src('./src/*.marko')
  .pipe(marko({preserveWhitespace: true}).on('error', gutil.log))
  // ...

Options

The options object supports the same options as the standard Marko compiler

TODO

Fully comply with Gulp plugin guidelines AKA write some tests

License

MIT License

Package Sidebar

Install

npm i gulp-markoc

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • mamboer