Note: for support questions, please use one of these channels: stackoverflow or slack
Note: the best way to get a quick answer is to provide a failing test case, by forking the following fiddle for example.
I would like to add that the following on the README.md
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io('http://localhost');
socket.on('connect', function(){});
socket.on('event', function(data){});
socket.on('disconnect', function(){});
</script>
// with ES6 import
import io from 'socket.io-client';
const socket = io('http://localhost');
Is misleading since it makes it look like you can use ES6 import on the client-side. Which you can't.
I was fooled as well. I do not always want to use webpack or similar.
ES6 imports are nothing new any more. Please make it work!
Many projects have a dedicated *.module.js which can be imported!
just adding on that .mjs is the preferred file type for ES6 modules.
Most helpful comment
I was fooled as well. I do not always want to use webpack or similar.
ES6 imports are nothing new any more. Please make it work!
Many projects have a dedicated *.module.js which can be imported!