fis3-hook-module
fis3-hook-module copied to clipboard
能增加个template设置吗
比如像 https://github.com/fex-team/fis-postprocessor-jswrapper
template : '!function(){${content}}();'
可以考虑直接给文件添加属性 wrap
为 closure
.
https://github.com/fex-team/fis3-hook-module/blob/master/index.js#L81
或者你也像那坨代码一样,在 fis-conf.js 里面版定个事件。
fis.on('compile:postprocessor', function() {
if (file.isJsLike && !file.isPartial) {
var content = file.getContent();
content = '!function(){${content}}();'.replace('${content}', content);
file.setContent(content);
}
});