webpack-contrib / webpack-bundle-analyzer

Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
MIT License
12.58k stars 488 forks source link

feat: Allows deterministic builds #349

Closed eoingroat closed 4 years ago

eoingroat commented 4 years ago

Allows building reports deterministically; a la Deterministic Compilation / Reproducible Builds

For now, that consists of adding an option to remove the report generation time from the report title; making the report generation reproducible across time.

tests

Tests are included, they check builds are deterministic with the deterministic API option true, and non-deterministic with the option false.

why

I've adopted a zero-config (a la yarn 2) and fully reproducible artifact build and test strategy; which means I need to commit my reports into a form of version control.

thoughts

I was going to propose this as a default to deterministic, however it may be the case that users use the included timestamp to determine the recency of the report when developing, and thus defaulted to the existing behavior.

jsf-clabot commented 4 years ago

CLA assistant check
All committers have signed the CLA.

valscion commented 4 years ago

Hi, thanks for the PR.

I'm not yet really into adding a configuration option for determinism, but maybe we could add a configuration option for the page title instead?

eoingroat commented 4 years ago

@valscion I'm happy with that; I'll get to it sometime this week.

Would you be happy if I added a test to check that a deterministic build is possible through some configuration - either in the same or another PR?

eoingroat commented 4 years ago

Closing in favour of #354

valscion commented 4 years ago

Would you be happy if I added a test to check that a deterministic build is possible through some configuration

I'm not yet sure if deterministic builds are ones we want to support as a first-class citizen, so preferably let's add that test in another PR later on so we can think on that separately from the title option ☺️