定义一个模块 /js/demo.js
define(function () {
//Do setup work here
return {
color: "black",
size: "unisize"
}
});
引用定义的模块 /main.js
requirejs(['js/demo'],function($,canvas,) {
//Do setup work here
});