Centralize and Automate Plugin Asset Minification in Webpack
Summary
Fixes #1711
This is also an attempt to improve the solution introduced in #1643 by further streamlining the process of generating minified asset files.
Relevant technical choices
- Removed Webpack configurations for Performance Lab, Embed Optimizer, and Image Prioritizer that existed solely for asset minification, making them redundant with the new centralized approach.
- Implemented plugin-specific minification:
- When running
npm run build:plugin:optimization-detective(or any specific plugin), only assets for that plugin are minified. - This prevents redundant minification when using
npm run build-pluginsscript, which would otherwise re-minify the same assets multiple times (while the overhead may be minimal, this approach avoids redundancy.)
- When running
- When
npm run buildis executed, it generates minified versions of assets across all plugins.
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 props-bot label.
If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
Co-authored-by: ShyamGadde <[email protected]>
Co-authored-by: westonruter <[email protected]>
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.
This issue has been resolved, please close it admin