Skip to content

Commit

Permalink
refactor(sio-client): mangle private attributes
Browse files Browse the repository at this point in the history
|          | before  | after   |
|----------|---------|---------|
| min+gzip | 14.6 KB | 14.3 KB |
| min+br   | 13.1 KB | 12.9 KB |

Reference: https://terser.org/docs/options/#mangle-properties-options
  • Loading branch information
darrachequesne committed Sep 21, 2024
1 parent 4f66708 commit 7085f0e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion packages/socket.io-client/support/rollup.config.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ module.exports = {
file: "./dist/socket.io.esm.min.js",
format: "esm",
sourcemap: true,
plugins: [terser()],
plugins: [
terser({
mangle: {
properties: {
regex: /^_/,
},
},
}),
],
banner,
},
plugins: [
Expand Down
10 changes: 9 additions & 1 deletion packages/socket.io-client/support/rollup.config.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ const prodBundle = {
format: "umd",
name: "io",
sourcemap: true,
plugins: [terser()],
plugins: [
terser({
mangle: {
properties: {
regex: /^_/,
},
},
}),
],
banner,
},
plugins: [
Expand Down

0 comments on commit 7085f0e

Please sign in to comment.