Skip to content
master
Go to file
Code
This branch is 1 commit ahead of easyPEP:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.md

gulp-eco

Gulp plugin to compile eco.js template engine

Install

Install with npm

npm install --save-dev gulp-eco

Example

js

var gulp = require('gulp');
var eco = require('gulp-eco');

gulp.task('eco', function () {
  return gulp.src(paths.templates)
    .pipe(eco({basePath: 'frontend/javascripts'}))
    .pipe(concat('templates.js'))
    .pipe(gulp.dest('./dist'));
});

gulp.task('default', ['eco']);

API

eco(options)

options.namespace

Type: String Default: JST

define your own namespace to access the templates:

eco({namespace: 'ECO'})

access templates via:

window.ECO["template_name"]({name: 'Manfred'})

options.basePath

Type: String Default: ``

eco compiles every template file into a function, which you can call with:

window.JST["template_name"]({name: 'Manfred'})

The template_name depends is the absolute path to the file. E.g.

/var/www/app/templates/users/users.jst.eco

By passing basePath: 'app/templates' you can strip the template_name to

users/users.jst

License

MIT © Kalle Saas kalle@easypep.de

About

simple gulpjs parser for eco template engine

Resources

You can’t perform that action at this time.