gulp-html-compile
Compile static ( no logic ) HTML templates into javascript files
Synopsis
This plugin is heavily inspired by Emanuele Ingrosso's gulp plugin which was itself inspired by Sindre Sorhus's gulp-nunjucks plugin.
Install
Install with npm
npm install gulp-html-compile --save-dev
Example
template
Welcome to my awesome site!
gulpfile
var gulp = template = concat = wrap = ; gulp;
API
template( options )
options
Type: object
options.name
Type: string
Default: Relative template path
Example: templates/header.html
You can override the default behavior by supplying a function which gets the current File object and is expected to return the name.
{ name: function( file ) { return file.relative.split( '.' )[ 0 ]; }}
options.namespace
Type: 'string' Default: 'templates'
The namespace in which the precompiled templates will be assigned.
namespace: 'MyCoolTemplates'