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
This commit is contained in:
Damien Arrachequesne
2024-09-21 07:48:32 +02:00
parent 4f66708210
commit 7085f0e3e4
2 changed files with 18 additions and 2 deletions

View File

@@ -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: [

View File

@@ -47,7 +47,15 @@ const prodBundle = {
format: "umd",
name: "io",
sourcemap: true,
plugins: [terser()],
plugins: [
terser({
mangle: {
properties: {
regex: /^_/,
},
},
}),
],
banner,
},
plugins: [