Skip to content

Commit

Permalink
feat: serve ESM bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Oct 13, 2021
1 parent 86e3aa9 commit 3759687
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions client-dist/socket.io.esm.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client-dist/socket.io.esm.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export class Server<
this.clientPathRegex = new RegExp(
"^" +
escapedPath +
"/socket\\.io(\\.min|\\.msgpack\\.min)?\\.js(\\.map)?(?:\\?|$)"
"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"
);
return this;
}
Expand Down
7 changes: 7 additions & 0 deletions test/socket.io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ describe("socket.io", () => {
testSourceMap("socket.io.msgpack.min.js.map")
);

it("should serve the ESM bundle", testSource("socket.io.esm.min.js"));

it(
"should serve the source map for the ESM bundle",
testSourceMap("socket.io.esm.min.js.map")
);

it("should handle 304", (done) => {
const srv = createServer();
new Server(srv);
Expand Down

0 comments on commit 3759687

Please sign in to comment.