has been prompting the path error, is it the baseUrl I misquoted, solve!
html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script src="assets/lib/require.js" data-main="assets/script/main"></script>
<script src="js/index.js"></script>
</body>
</html>
main.js
require.config({
baseUrl: "./assets/lib",
map: {
"*": {
"css": "css.min"
}
},
paths: {
"jquery": "jquery.min",
"bootstrap":"bootstrap/bootstrap"
},
shim: {
"bootstrap":{
deps:[
"jquery",
"css!../lib/bootstrap/bootstrap"
]
}
}
});
public.js
define(["jquery"],function ($){
function conText(){
console.log("");
$("body").html("Hello,world!");
}
function alertTxt(text){
console.log(text);
}
return {
conText:conText,
alertTxt:alertTxt
};
});