Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jiangjie/gulp-lodash-template
gulp插件,将lodash模板文件预编译成function,支持JST、AMD和CommonJS输出
https://github.com/jiangjie/gulp-lodash-template
Last synced: 6 days ago
JSON representation
gulp插件,将lodash模板文件预编译成function,支持JST、AMD和CommonJS输出
- Host: GitHub
- URL: https://github.com/jiangjie/gulp-lodash-template
- Owner: JiangJie
- License: mit
- Created: 2014-11-05T08:25:21.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-13T02:05:24.000Z (over 8 years ago)
- Last Synced: 2024-08-09T20:31:25.118Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
gulp-lodash-template
====================> gulp插件,将lodash模板文件预编译成function,支持JST、AMD和CommonJS输出
> Precompile lodash.template to a function.
## Install
```
npm install gulp-lodash-template --save-dev
```## Example
### `gulpfile.js`
```js
var template = require('gulp-lodash-template');gulp.task('tmpl', function() {
return gulp.src('./tmpl/*.html')
.pipe(template({
commonjs: true,
// amd: true,
strict: true
}))
.pipe(gulp.dest('./tmpl/'));
});
```### template(options)
### options
Type: `Object`
#### options.strict
Type: `Boolean`
Default: falseAdd `use strict;` at the first line of the compiled template function.
#### options.es6module
Type: `Boolean`
Default: false#### options.commonjs
Type: `Boolean`
Default: false#### options.amd
Type: `Boolean`
Default: false#### options.namespace
Type: `String`
Default: 'JST'