-->

如何通过brocfile为灰烬CLI应用程序中导入socket.io?(How to import

2019-10-22 06:11发布

我想用socket.io我烬CLI应用程序,所以我安装:

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

有任何想法吗?

Answer 1:

结束了使用socket.io客户端其中进口没有错误。

app.import('bower_components/socket.io-client/socket.io.js');


文章来源: How to import socket.io via brocfile for ember cli application?