From 1918fe9e2520eff8a783a6b49a5e05ab8a49ce9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=83=C2=B3=C3=85=E2=80=9Akowski?= Date: Thu, 4 Nov 2021 15:56:06 +0000 Subject: [PATCH] Build: Remove polyfills from block view scripts Related changes in Gutenberg: https://github.com/WordPress/gutenberg/pull/35038. When adding a block with a view.js script, the frontend loads an additional ~20kb of scripts that were previously not there. These are coming from polyfills that are defined as a dependency for view.js scripts. Since WordPress dropped support for IE, these polyfills are no longer needed and can be removed. Follow-up to [51501]. See #53690. Props aristath. git-svn-id: https://develop.svn.wordpress.org/trunk@52011 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/blocks/file/view.asset.php | 2 +- src/wp-includes/blocks/file/view.min.asset.php | 2 +- tools/webpack/blocks.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/blocks/file/view.asset.php b/src/wp-includes/blocks/file/view.asset.php index d79882a2c6..ced72a7dd2 100644 --- a/src/wp-includes/blocks/file/view.asset.php +++ b/src/wp-includes/blocks/file/view.asset.php @@ -1 +1 @@ - array('wp-polyfill'), 'version' => '499eaf2efb98327a07f222e92d742380'); \ No newline at end of file + array(), 'version' => '499eaf2efb98327a07f222e92d742380'); \ No newline at end of file diff --git a/src/wp-includes/blocks/file/view.min.asset.php b/src/wp-includes/blocks/file/view.min.asset.php index fb44b982ae..3c640496af 100644 --- a/src/wp-includes/blocks/file/view.min.asset.php +++ b/src/wp-includes/blocks/file/view.min.asset.php @@ -1 +1 @@ - array('wp-polyfill'), 'version' => 'e8d668b8e69d9bf1c99dc250d92f2b72'); \ No newline at end of file + array(), 'version' => 'e8d668b8e69d9bf1c99dc250d92f2b72'); \ No newline at end of file diff --git a/tools/webpack/blocks.js b/tools/webpack/blocks.js index bf7e1dff24..2934732ab3 100644 --- a/tools/webpack/blocks.js +++ b/tools/webpack/blocks.js @@ -178,7 +178,7 @@ module.exports = function( env = { environment: 'production', watch: false, buil ), } ), new DependencyExtractionPlugin( { - injectPolyfill: true, + injectPolyfill: false, } ), new CopyWebpackPlugin( [