gulp-tmpl2js
Gulp plugin for compile tmpl to js string, optional amd or commonjs wrapper.
Install
$ npm install --save-dev gulp-tmpl2js
Usage
var gulp = ;var tmpl2js = ; gulp;
API
tmpl2js([options])
Options:
-
mode
: A string naming js code style. Optional. Possible values:undefined
(default): keep space and carriage of source htmlcompress
: strip the extra spaces or carriage at the beginnings and ends of the linesformat
: format js code as spec
-
wrap
: A string naming js code wrapper. Optional. Possible values: -
ignoreScriptTag
: boolean to ignore fix split the script tag when writing it with document write. Defaults tofalse
-
clone
: boolean to keep source tpl file. Defaults tofalse
-
ext
: target file extname. Defaults to.js
Examples
define
Compress html and wrap with var gulp = ;var tmpl2js = ; gulp;
Input
i am test
Output
;
Related
License
MIT