seajs.config({这段代码,有略显多余的地方吗?是不是每个jq插件,都要按照jquery.easing那样写在shim里面呢?
alias:{
'jquery': 'lib/jquery-1.9.1.min.js',
'jquery.easing': 'lib/jquery.easing.1.3.js'
},
// Enable plugins
plugins: ['shim'],
// Configure shim for non-CMD modules
shim: {
'jquery': {
src: 'lib/jquery-1.9.1.min.js',
exports: 'jQuery'
},
'jquery.easing': {
src: 'lib/jquery.easing.1.3.js',
deps: ['jquery']
}
}
});
non-CMD模块采用shim插件,一般的jquery插件,手动转换为CMD插件很容易。只有类似jq ui或者my97那种有内部依赖机制的,建议使用shim。
--
You received this message because you are subscribed to the Google Groups "seajs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seajs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
use non-CMD模块,只能加载代码文件,并执行,不会通过exports提供接口。对于non-CMD模块,要么封装,要么使用shim加载,不建议直接当做标准模块使用。
个人觉得应该封装,但实际可能还要取决于项目里插件数量和封装难易度