我正在嘗試使用Requirejs加載Raphaeljs。我在這裏嘗試這樣的解決方案: https://github.com/DmitryBaranovskiy/raphael/pull/540RaphaelJs和RequireJs不工作Togther
但是當我加載它,我得到:
Uncaught TypeError: Cannot call method 'on' of undefined
我期待更多的到它,我看到前夕是不確定的。任何人有任何想法得到這個與requirejs?
我正在嘗試使用Requirejs加載Raphaeljs。我在這裏嘗試這樣的解決方案: https://github.com/DmitryBaranovskiy/raphael/pull/540RaphaelJs和RequireJs不工作Togther
但是當我加載它,我得到:
Uncaught TypeError: Cannot call method 'on' of undefined
我期待更多的到它,我看到前夕是不確定的。任何人有任何想法得到這個與requirejs?
我幾個星期前,遇到了同樣的問題,但我是用JamJS,這是一個前端包管理使用Require.JS和管理require.config.js你。
這可能無法解決您的問題,因爲我使用JamJS,但無論什麼值得我在這裏解決:我爲RaphaelJS創建了一個包 - 使用pmcelhaney's fork和Eve。您可以從
您可以克隆拉斐爾和更新子模塊爲梅德介紹here,然後RequireJS,這樣做:
paths: {
"eve": "libs/raphael/eve/eve",
"raphael": "libs/raphael/raphael"
},
shim: {
'eve': {
exports: "eve"
},
'raphael': {
deps: ["eve"],
exports: "Raphael"
}
}
只要在需要時使用"raphael"
作爲依賴關係。