gulp-emblem
v0.1.0
Published
Emblem.js plugin for gulp
Downloads
3
Readme
gulp-emblem
Emblem.js plugin for gulp ...a concise, beautiful, and fully compatible templating alternative for Handlebars.js.
Usage
First, install gulp-emblem and gulp-define-module as development dependencies:
npm install --save-dev gulp-emblem gulp-define-module
Then, add it to your gulpfile.js
:
var emblem = require('gulp-emblem');
var defineModule = require('gulp-define-module');
gulp.task('templates', function(){
gulp.src(['client/templates/*.em'])
.pipe(emblem())
.pipe(defineModule('node'))
.pipe(gulp.dest('build/templates/'));
});
gulp-emblem outputs a raw handlebars function, so it is likely that you will want to use gulp-define-module to make the handlebars template available via a specific namespace or for use with a module system. For additional usage examples, we recommend that you visit gulp-handlebars and gulp-define-module.
Compiling to various module systems
gulp-define-module can be used to prepare the output for use with common module systems such as AMD, Node, and CommonJS. Please see the documentation for more details on how to use that in a gulp chain.
gulp-emblem makes the following available for use in the define-module wrapper:
handlebars
: The handlebars template fully wrapped (Handlebars.template(<%= contents %>)
).
API
emblem(options)
options.compilerOptions
Type: Object
Compiler options to pass to Emblem.precompile()
.
Attributions
This project is a fork of gulp-handlebars
by lazd.
Emblem.js is a concise, beautiful, and fully compatible templating alternative for Handlebars.js.