Skip to content

Commit

Permalink
DEWP: Check for magic comments before minification (#65582)
Browse files Browse the repository at this point in the history
Look for magic wp:polyfill comments before minification.

Avoids having to configure Terser to preserve these comments, and also avoids having them in the minified JS.

Minifiers run in the processAssets hook at the
`PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE` stage. If we hook at the `PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY` stage to check for the magic comments, we don't have to worry about configuring Terser to preserve them (and won't have to have them making the output slightly larger either).

---------

Co-authored-by: anomiex <bjorsch@git.wordpress.org>
Co-authored-by: gziolo <gziolo@git.wordpress.org>
Co-authored-by: sirreal <jonsurrell@git.wordpress.org>
Co-authored-by: sgomes <sergiomdgomes@git.wordpress.org>
  • Loading branch information
5 people authored and cbravobernal committed Oct 7, 2024
1 parent dc70023 commit 6cc91c7
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 6cc91c7

Please sign in to comment.