使用shim by requirejs2,有一種方法可以告訴要求模塊已經加載?Requirejs using shim
例子:
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="undescrore.js"></script>
<script type="text/javascript" src="require.js'"></script>
<script type="text/javascript">
require.config({
paths: {
"backbone": '/vendor/js/backbone-min.js'
},
shim: {
'backbone': {
//These script dependencies should be loaded before loading
//backbone.js
deps: ['underscore', 'jquery'], // here I would like to load the already loaded library
}
}
});
</script>