-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add bundle with msgpack parser
Pros: - events with binary content are sent as 1 WebSocket frame (instead of 2 with the default parser) - payloads with lots of numbers should be smaller Cons: - no IE9 support (https://caniuse.com/mdn-javascript_builtins_arraybuffer) - a slightly bigger bundle size (61.1 vs 59.9 KB) Source: https://github.com/darrachequesne/socket.io-msgpack-parser
- Loading branch information
1 parent
f3cbe98
commit 71d6048
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const { NormalModuleReplacementPlugin } = require("webpack"); | ||
const config = require("./prod.config"); | ||
|
||
module.exports = { | ||
...config, | ||
output: { | ||
...config.output, | ||
filename: "socket.io.msgpack.min.js", | ||
}, | ||
plugins: [ | ||
...config.plugins, | ||
new NormalModuleReplacementPlugin( | ||
/^socket.io-parser$/, | ||
"socket.io-msgpack-parser" | ||
), | ||
], | ||
}; |