fis
fis copied to clipboard
debug大家如何做,比如通过参数开启debug
比如?debug=1加载压缩前、合并前代码 目前我是用ssi判断是否存在相应参数 并输出对应代码。 fis每次编译的时候产出两份文件,一份压缩前、一份压缩后
同问
在fis-config.js中获取fis.cli.commander,判断相关参数,然后就随便发挥咯~
例如我在测试环境增加了一些辅助测试的工具
var dest = fis.cli.commander.commands[0].dest;
fis.config.set('modules.parser.html', function (content, file, settings) {
if (file.filename === 'home') {
content += '\n<script>require("crm/app.debug");</script>';
}
return content;
});