File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
plugins/optimization-detective Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -709,6 +709,9 @@ export default async function detect( {
709709 /** @type {string[] } */
710710 const initializingExtensionModuleUrls = [ ] ;
711711
712+ /** @type {boolean } */
713+ let extensionHasFinalize = false ;
714+
712715 for ( const extensionModuleUrl of extensionModuleUrls ) {
713716 try {
714717 /** @type {Extension } */
@@ -744,7 +747,7 @@ export default async function detect( {
744747 }
745748
746749 if ( extension . finalize instanceof Function ) {
747- compressionEnabled = false ;
750+ extensionHasFinalize = true ;
748751 }
749752 } catch ( err ) {
750753 error (
@@ -754,6 +757,13 @@ export default async function detect( {
754757 }
755758 }
756759
760+ if ( extensionHasFinalize ) {
761+ compressionEnabled = false ;
762+ warn (
763+ 'URL Metric compression is disabled because one or more extensions use the deprecated finalize function.'
764+ ) ;
765+ }
766+
757767 // Wait for all extensions to finish initializing.
758768 const settledInitializePromises = await Promise . allSettled (
759769 extensionInitializePromises
You can’t perform that action at this time.
0 commit comments