Skip to content

Commit

Permalink
chore(build): Use standard regex for wasm terser mangle.properties
Browse files Browse the repository at this point in the history
…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.)
  • Loading branch information
lobsterkatie authored Feb 17, 2022
1 parent af6c24f commit 1bf9883
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/wasm/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const terserInstance = terser({
// We need those full names to correctly detect our internal frames for stripping.
// I listed all of them here just for the clarity sake, as they are all used in the frames manipulation process.
reserved: ['captureException', 'captureMessage', 'sentryWrapped'],
properties: false,
properties: {
regex: /^_[^_]/,
},
},
output: {
comments: false,
Expand Down

0 comments on commit 1bf9883

Please sign in to comment.