gulp-inject-template
Replaces require
calls to html files with precompiled lodash/underscore template functions in your JS files.
Example
Input
var template = ;
<!-- ./template.html -->TemplateWith variable: <%= data %>
Output
var {obj || obj = {}; var __t __p = '';with obj __p += '<h1>Template</h1>\nWith variable: ' +__t = data == null ? '' : __t; return __p};
Usage
gulp;
Arguments
Argument | Type | Description |
---|---|---|
options |
optional, Object | Object that will be passed down to lodash template function as options. More details in the lodash documentation. |
gulp-inject-template
with buffers
Using gulp-inject-template
currently does not support buffers.
If you want to use it with Babel or another module that does not support streams, you can wrap those plugins using gulp-streamify.
var streamify = ; gulp;
Todo
- Support source maps
- Support buffers