提取kissy深层依赖
适用于kissy1.2+以上版本,不适合kissy5.0+
app/index.js
KISSY.add('app/index',function(S,Node,Feature){
//...
},{
requires:['node','components/feature/']
})
components/feature/index.js
KISSY.add('components/feature/',function(S,io){
//...
},{
requires:['io']
})
var extracter = require('gulp-kissy-transport')
extracter.config('packages', [{
name: 'app',
path: './test/app'
}, {
name: 'components',
path: './test/components'
}, {
name: 'common',
path: './test/app'
}])
gulp.src(['./test/**/*.js','!./test/build/**/*.js'])
.pipe(extracter.deepenDeps())
.pipe(gulp.dest('./test/build'))
首先配置kissy的包,参考对比kissy包配置详情
app/index.js
KISSY.add('app/index',function(S,Node,Feature){
//...
},{
requires:['node','components/feature/','io']
})
mat服务可以支持combo请求
npm install mat -g mat