mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
The previous commit, while successfully restoring support for:
```js
const socket = require("socket.io-client")(...);
```
breaks for some other cases:
- https://github.com/socketio/socket.io/issues/4128
- https://github.com/socketio/socket.io-client/issues/1509
According to [1], we should use `export = `, but this is not supported
by module "esnext":
> Export assignment cannot be used when targeting ECMAScript modules
So we'll go for this ugly workaround, at least until we remove the
default export in the next major release.
[1]: https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require