fis3-hook-module icon indicating copy to clipboard operation
fis3-hook-module copied to clipboard

能增加个template设置吗

Open 303182519 opened this issue 9 years ago • 2 comments

比如像 https://github.com/fex-team/fis-postprocessor-jswrapper

template : '!function(){${content}}();'

303182519 avatar Aug 17 '15 14:08 303182519

可以考虑直接给文件添加属性 wrapclosure.

https://github.com/fex-team/fis3-hook-module/blob/master/index.js#L81

2betop avatar Aug 17 '15 22:08 2betop

或者你也像那坨代码一样,在 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);
  }
});

2betop avatar Aug 17 '15 23:08 2betop