我已将requirejs
用于我自己的模块(使用define
),但我无法将shim
用于createjs
。我已经浏览了无数个例子并最终使用了这个:https://github.com/CreateJS/EaselJS/wiki/Using-easeljs-and-tweenjs-with-requirejs,但我收到net::ERR_ABORTED
错误
我的模块:
define(function (require) {
var createjs = require('createjs');
var start = function () {
var canvas = document.getElementById('canvas');
var stage = new createjs.Stage(canvas);
}
return {
start: start
};
});
我的配置:
require.config({
shim: {
easel: {
exports: 'createjs'
}
},
paths: {
easel: 'libs/easeljs.min'
}
});