<script src="lib/requirejs/require.js " data-main="js/main.js"> </script>
再入口文件main.js里面需:
require.config({
shim:{
"bootstrap":{
exports:'bootstrap',
degs:['jquery']
}
},
paths : {
"jquery" : './jquery/dist/jquery.min' ,
"bootstrap":"./bootstrap/dist/js/bootstrap.min",
"index":"./index"
}
})
require(["jquery","bootstrap","index"],function($,bootstrap,index){
$(function(){
console.log('你好,国服第一李师师!');
alert('lishishi');
})
})