问题
I want to use socket.io in my ember cli application, so I installed with:
bower install socket.io --save
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
Any ideas?
回答1:
Ended up using socket.io-client which imports without errors.
app.import('bower_components/socket.io-client/socket.io.js');
来源:https://stackoverflow.com/questions/29025058/how-to-import-socket-io-via-brocfile-for-ember-cli-application