feather2中有一些常见配置,比如:
* statics: 设置静态资源的路径前缀,默认为static,比如static/1.js, 实际上static就是statics配置值, 当statics改变时,编译后的static下的文件也会做对应的改变
feather.config.set('statics', 'abc');
index.html
<script src="/static/1.js"></script>
编译后:
<script src="/abc/1.js"></script>
实际上非static目录下的静态资源,比如widget、pagelet、components及零散的资源,也会被feather自动编译至 static目录下的对应目录,用户无需额外关心资源
feather.config.set('project.domain', '//127.0.0.1:8080');
feather.config.set('autoPack.type', 'combo');
feather.match('**.js', {
useJsWraper: false, //所有js不自动包裹define头部,一般在使用非模块化时使用
useHash: false //不使用版本号
});
//该配置feather中已默认使用
feather.match('static/third/**', {
parser: false, //不做任何预编译处理,比如less,es6等
useHash: false //不加版本号
});
feather.config.set('pack', {
'static/pkg.js': 'static/**.js'
});