performance icon indicating copy to clipboard operation
performance copied to clipboard

Centralize and Automate Plugin Asset Minification in Webpack

Open ShyamGadde opened this issue 1 year ago • 1 comments

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-plugins script, which would otherwise re-minify the same assets multiple times (while the overhead may be minimal, this approach avoids redundancy.)
  • When npm run build is executed, it generates minified versions of assets across all plugins.

ShyamGadde avatar Dec 03 '24 14:12 ShyamGadde

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.

github-actions[bot] avatar Dec 04 '24 00:12 github-actions[bot]

This issue has been resolved, please close it admin

phanduynam avatar Apr 03 '25 13:04 phanduynam