在實際項目中凯砍,有些組件不符合AMD規(guī)范該如何,此時需要使用shim參數(shù)來進行相應(yīng)配置
example
//people模塊 people.js
;(function(){
function People(){
}
People.prototype = {}
window.people = People;
})()
require.config({
paths: {
'people': 'control/people.js'
},
shim:{
'people':{
deps: ['jquery'],
exports: 'p'
}
}
})
require(['people'],function(){
new p()
})