From 3d87ce1f6aa79af8b7c29d90c3e873cf24f52375 Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 26 Mar 2025 21:21:13 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Remove=20unnecessary=20HMR=20cli?= =?UTF-8?q?ent=20setup=20(#3241)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/setup.php | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/app/setup.php b/app/setup.php index b450152..3bc48e6 100644 --- a/app/setup.php +++ b/app/setup.php @@ -46,35 +46,6 @@ add_filter('admin_head', function () { ])->toHtml(); }); -/** - * Add Vite's HMR client to the block editor. - * - * @return void - */ -add_action('enqueue_block_assets', function () { - if (! is_admin() || ! get_current_screen()?->is_block_editor()) { - return; - } - - if (! Vite::isRunningHot()) { - return; - } - - $script = sprintf( - <<<'JS' - window.__vite_client_url = '%s'; - - window.self !== window.top && document.head.appendChild( - Object.assign(document.createElement('script'), { type: 'module', src: '%s' }) - ); - JS, - untrailingslashit(Vite::asset('')), - Vite::asset('@vite/client') - ); - - wp_add_inline_script('wp-blocks', $script); -}); - /** * Use the generated theme.json file. *