【文件属性】:
文件名称:gulp-ejs-template:将 EJS 模板预编译为 JS 文件
文件大小:11KB
文件格式:ZIP
更新时间:2021-06-28 10:14:20
JavaScript
gulp-ejs-模板
将 EJS 模板预编译为 JS 文件。
仅支持 v2.x 。
安装
使用安装
npm install --save-dev gulp-ejs-template
用法
var gulpEjs = require ( 'gulp-ejs-template' ) ;
gulp . task ( 'ejsTemplate' , function ( ) {
return gulp . src ( 'test/fixtures/*.html' )
. pipe ( gulpEjs ( {
moduleName : 'templates'
} ) )
. pipe ( gulp . dest ( 'test' ) ) ;
} ) ;
演示
test/fixtures/header.html :
< p> < %= locals.title |
【文件预览】:
gulp-ejs-template-master
----.gitignore(587B)
----README.md(4KB)
----test()
--------templates.js(2KB)
--------fixtures()
--------index.js(514B)
----LICENSE(1KB)
----.jshintrc(397B)
----package.json(889B)
----index.js(2KB)
----.travis.yml(49B)
----lib()
--------ejs.js(6KB)
--------templates.js(1KB)
----gulpfile.js(374B)