安装: npm install gulp-tpl-to-js --save-dev
template
1.html
2.html
d1
d1_1.html
d1_2.html
d1_dd1
d1_dd1_1.html
d1_dd1_2.html
var gulp = require('gulp');
var tpl=require('gulp-tpl2js');
gulp.task('default',function(done){
tpl({
dir:'./template',
dest:'.template.js/',
type:'cmd'
});
done();
});
type 字段是可选的,不传入的时候为commonjs模块。