[wp-trac] [WordPress Trac] #53192: Use hashed/deterministic moduleIDs in Webpack build.
WordPress Trac
noreply at wordpress.org
Wed May 12 05:00:41 UTC 2021
#53192: Use hashed/deterministic moduleIDs in Webpack build.
------------------------------+-----------------------------
Reporter: peterwilsoncc | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version: 5.0
Severity: normal | Keywords: has-patch
Focuses: javascript |
------------------------------+-----------------------------
The current Webpack configuration uses numeric values for the module IDs.
This can result in apparently minor changes to the code causing a large
number of files to be rebuilt.
For example [50431] seems to have triggered a complete rebuild of
JavaScript files [build50042], the only change in many of the files is the
module IDs.
Webpack 4 has an option to generate module IDs based on a hash of the
file's path. After some quick testing, I think this will reduce the
frequency of complete JavaScript rebuilds.
I've attached a patch but I would love a review and some testing from a
few folk more familiar with Webpack.
Note: Webpack 5 deprecates the `hashed` option in favour of
`deterministic`. Reading the documentation, it looks like the algorithm
has changed in addition to the name.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53192>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list