Build: Only generate asset file once and keep version consistent#74051
Build: Only generate asset file once and keep version consistent#74051youknowriad merged 1 commit intotrunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
ecdaa5b to
02d2380
Compare
02d2380 to
10cb4cc
Compare
|
Flaky tests detected in 10cb4cc. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20276620816
|
Related WordPress/wordpress-develop#10638
Problem
Both minified and non-minified builds were generating the same
.asset.phpfile concurrently, causing a race condition. The hash would alternate between two values depending on which build finished last:index.min.js+index.min.js.mapindex.js+index.js.mapThis made builds non-deterministic, causing unnecessary git diffs on every rebuild.
Solution
generateAssetFileparameter towordpressExternalsPlugin()(defaults totrue).asset.phpfileThis ensures each
.asset.phpfile is written exactly once with a consistent hash.Testing
Verified multiple consecutive builds produce identical
.asset.phpfiles with stable hashes.