如何通过 ember cli 应用程序的 brocfile 导入 socket.io?
How to import socket.io via brocfile for ember cli application?
我想在我的 ember cli 应用程序中使用 socket.io,所以我安装了:
bower install socket.io --save
并在我的 Brocfile.js
中添加了以下行:
app.import('bower_components/socket.io/index.js');
这导致我的浏览器控制台出现两个错误:
Uncaught ReferenceError: module is not defined
Uncaught Error: Could not find module ember-moment/helpers/moment
有什么想法吗?
最终使用 socket.io-client 导入,没有错误。
app.import('bower_components/socket.io-client/socket.io.js');
我想在我的 ember cli 应用程序中使用 socket.io,所以我安装了:
bower install socket.io --save
并在我的 Brocfile.js
中添加了以下行:
app.import('bower_components/socket.io/index.js');
这导致我的浏览器控制台出现两个错误:
Uncaught ReferenceError: module is not defined
Uncaught Error: Could not find module ember-moment/helpers/moment
有什么想法吗?
最终使用 socket.io-client 导入,没有错误。
app.import('bower_components/socket.io-client/socket.io.js');