Skip to content

Commit 7085f0e

Browse files
refactor(sio-client): mangle private attributes
| | 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
1 parent 4f66708 commit 7085f0e

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

packages/socket.io-client/support/rollup.config.esm.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ module.exports = {
1515
file: "./dist/socket.io.esm.min.js",
1616
format: "esm",
1717
sourcemap: true,
18-
plugins: [terser()],
18+
plugins: [
19+
terser({
20+
mangle: {
21+
properties: {
22+
regex: /^_/,
23+
},
24+
},
25+
}),
26+
],
1927
banner,
2028
},
2129
plugins: [

packages/socket.io-client/support/rollup.config.umd.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,15 @@ const prodBundle = {
4747
format: "umd",
4848
name: "io",
4949
sourcemap: true,
50-
plugins: [terser()],
50+
plugins: [
51+
terser({
52+
mangle: {
53+
properties: {
54+
regex: /^_/,
55+
},
56+
},
57+
}),
58+
],
5159
banner,
5260
},
5361
plugins: [

0 commit comments

Comments
 (0)