fis3-prepackager-dot-compiler
Version:
配合fis3-parser-dot-compiler使用的,doT.js的fis3编译模板收集打包处理插件
22 lines (20 loc) • 593 B
JavaScript
/**
* doT template compiler
* @author fang 2015年10月30日12:00:18
*/
;
module.exports = function(ret, conf, settings, opt) {
var ids = ret.ids || {};
fis.util.map(ids, function (src, file) {
if (file.isDotTemplate) {
var subpath = getCompactTemplateJsSubPath(file);
conf[subpath] = conf[subpath] || [];
conf[subpath].push(file.subpath);
}
});
}
function getCompactTemplateJsSubPath(file){
var path = file.subpath.replace('\\','/').split('/');
path.pop();
return path.join('/')+'/template.js';
}