如何通过brocfile为ember cli应用程序导入socket.io? [英] How to import socket.io via brocfile for ember cli application?

查看:171
本文介绍了如何通过brocfile为ember cli应用程序导入socket.io?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的ember cli应用程序中使用 socket.io ,所以我安装了:

I want to use socket.io in my ember cli application, so I installed with:

bower install socket.io --save

并将以下行添加到我的 Brocfile.js

And added the following line to my Brocfile.js:

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

这导致我的浏览器控制台出现两个错误:

This results in two errors in my browser console:

Uncaught ReferenceError: module is not defined
Uncaught Error: Could not find module ember-moment/helpers/moment

任何想法?

推荐答案

结束使用 socket.io-client 导入没有错误。

Ended up using socket.io-client which imports without errors.

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

这篇关于如何通过brocfile为ember cli应用程序导入socket.io?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆