chore(build): Update and hoist rollup-plugin-terser
#4539
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In preparation for the new bundling process, this updates
rollup-plugin-terser
to latest and hoists it into the mainpackage.json
.To see what effects this has on the resulting minified bundles (because this is terser we're talking about, there's no effect on non-minified bundles), it's easiest to think of the upgrade in stages.
First bump: 4.x -> 5.x.
Effect 1: License text in minified bundles:
This can be mitigated by enforcing the removal of comments (in the terser settings):
Effect 2: Extra parentheses. This is easiest to see in a file where each character has been put on its own line.
Second bump: 5.x -> 6.x
This results in no bundle changes
Third bump: 6.x -> 7.x
(Note: screenshots are all from
bundle.min.js
from@sentry/browser
after it's been run through auto-formatting to make it easier for git to figure out what the actual differences are.)Effect 1:
return (x = someFunc)(args)
->return( (x = someFunc), x(args) )
Effect 2: Assigning repeated values to a variable
Effect 3: Lots of renaming of single-letter variables
Because these are all essentially cosmetic changes, this should be a safe upgrade.