Skip to content

Commit 1bf9883

Browse files
authored
chore(build): Use standard regex for wasm terser mangle.properties option (#4592)
Currently, `@sentry/wasm`'s minification settings (the `mangle.properties` option in rollup's terser plugin) prevent the mangling of any property names. (Note: This is different from variable names, which do get mangled.) In other packages, internal property names (those starting with a single `_`) _are_ mangled. This ports that setting to the wasm package, which turns out not to meaningfully change the bundle, because nowhere in the package do such properties appear. As a result, the only effects of this change are different single-letter variables being used in the final minified bundle. (For a screenshot of the changes, see the corresponding PR.)
1 parent af6c24f commit 1bf9883

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/wasm/rollup.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ const terserInstance = terser({
1010
// We need those full names to correctly detect our internal frames for stripping.
1111
// I listed all of them here just for the clarity sake, as they are all used in the frames manipulation process.
1212
reserved: ['captureException', 'captureMessage', 'sentryWrapped'],
13-
properties: false,
13+
properties: {
14+
regex: /^_[^_]/,
15+
},
1416
},
1517
output: {
1618
comments: false,

0 commit comments

Comments
 (0)