google / closure-compiler

A JavaScript checker and optimizer.
https://developers.google.com/closure/compiler/
Apache License 2.0
7.41k stars 1.15k forks source link

Add variable and input map command line arguments. #4155

Closed nhelfman closed 8 months ago

nhelfman commented 9 months ago

The change re-enables existing functionality which has been previously disabled as part of change e17ddd9271874add9608c71dd9d257a5f6e6c085.

The reason to re-enable it at this time is to enable minimal binary compression diff between to build versions. Without using input maps, 2 compilation builds, even when have small changes between them may result with completely different minified file due to renames which occur at different order and pick different rename value. When using input rename maps the resulting minified code remains very similar to minified code from earlier build version.

This is important for adopting Compression Dictionary Transport which greatly benefit from small compressed dictionary diffs.

The change addresses the ask in #4097

brad4d commented 8 months ago

I've imported this PR and sent it for internal review and testing.