diff --git a/lib/index.ts b/lib/index.ts index 19825dd96e..97f702717a 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -272,7 +272,9 @@ export class Server extends EventEmitter { const escapedPath = this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); this.clientPathRegex = new RegExp( - "^" + escapedPath + "/socket\\.io(\\.min)?\\.js(\\.map)?$" + "^" + + escapedPath + + "/socket\\.io(\\.min|\\.msgpack\\.min)?\\.js(\\.map)?$" ); return this; } diff --git a/package.json b/package.json index 4cc5b296a4..5d8170659b 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ ], "files": [ "dist/", + "client-dist/", "wrapper.mjs" ], "type": "commonjs", diff --git a/test/socket.io.ts b/test/socket.io.ts index 397bd46c5b..bc7377bce9 100644 --- a/test/socket.io.ts +++ b/test/socket.io.ts @@ -92,6 +92,16 @@ describe("socket.io", () => { }); }); + it( + "should serve bundle with msgpack parser", + testSource("socket.io.msgpack.min.js") + ); + + it( + "should serve source map for bundle with msgpack parser", + testSourceMap("socket.io.msgpack.min.js.map") + ); + it("should handle 304", done => { const srv = createServer(); new Server(srv);