0.1.6 • Published 10 years ago

gulp-cmd-jst v0.1.6

Weekly downloads
1
License
ISC
Repository
github
Last release
10 years ago

gulp-cmd-jst Build Status

Compile lodash templates to a JST file using gulp.

Install

Install using npm.

npm install gulp-cmd-jst --save-dev

Usage

var gulp = require('gulp');
var jst = require('gulp-cmd-jst');

gulp.task('jst', function() {
    gulp.src('input/*.html')
        .pipe(jst(
            {
                templateSettings: {
                  evaluate: /##([\s\S]+?)##/g,
                  interpolate: /\{\{(.+?)\}\}/g,
                  escape: /\{\{\{\{-([\s\S]+?)\}\}\}\}/g
                },
                //filter escape character
                processContent: function(src) {
                  return src.replace(/(^\s+|\s+$)/gm, '');
                },
                //compress Jst
                prettify: true, 
                //cmd: true || amd: true        
                cmd: true
            }
        ))
        .pipe(gulp.dest('./output'));
});

gulp.task('default', ['jst']);

###Note: 版本 version

  • 0.1.5: the code will remove escape character from lodash when setting 'prettify: true'
  • 0.1.5: 当设置 prettify: true时,jst代码压缩为一行,并去掉lodash转义过来的字符
  • 0.1.6: change settings options

jst(options)

gulp-cmd-jst accepts the same _.template options as the lodash library.

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago