diff --git a/package.json b/package.json index 484e7eebf..289eb9748 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,17 @@ "dist/", "build/" ], + "type": "commonjs", "main": "./build/index.js", + "exports": { + "./package.json": "./package.json", + "./dist/socket.io.js": "./dist/socket.io.js", + "./dist/socket.io.js.map": "./dist/socket.io.js.map", + ".": { + "import": "./wrapper.mjs", + "require": "./build/index.js" + } + }, "types": "./build/index.d.ts", "dependencies": { "backo2": "1.0.2", diff --git a/wrapper.mjs b/wrapper.mjs new file mode 100644 index 000000000..b914d4cdd --- /dev/null +++ b/wrapper.mjs @@ -0,0 +1,4 @@ +import io from "./build/index.js"; + +export const Manager = io.Manager; +export default io;