0
在我requireJS配置我有使用RequrieJS加載CreateJS。 「墊片」選項這麼想的工作
require.config({
baseUrl: "js",
paths: {
react: "libs/react/" + (DEBUG ? "react" : "react.min"),
domready: "libs/require/plugins/domready.min",
superagent: "libs/superagent/superagent.min",
createjs: "libs/createjs/createjs.min" //Combined createJS lib
},
shim: {
createjs: { exports: "createjs" }
},
waitSeconds: 0
});
然後我想需要createJS作爲我模塊的依賴
define(
[
"react",
"createjs",
"config",
"common"
],
function(React, CreateJS, Config, Common) {
console.log(CreateJS); //Didn't work. Returning empty require module object
console.log(createjs); //Proper CreateJS object
}
);
CreateJS不是全局變量createjs的實際表現。墊片選項什麼都不做。沒有墊片的結果相同