As far as I have seen, there is no explanation as to where we are to locate the client side script for socket.io
if node.js
is not used as the web
I used bower as suggested in Matt Way's answer, and that worked great, but then the library itself didn't have its own bower.json
file.
This meant that the bower-main-files
Gulp plugin that I'm using to find my dependencies' JS files did not pull in socket.io, and I was getting an error on page load. Adding an override to my project's bower.json
worked around the issue.
First install the library with bower:
bower install socket.io-client --save
Then add the override to your project's bower.json:
"overrides": {
"socket.io-client": {
"main": ["socket.io.js"]
}
}