Skip to content

Commit 3d87ce1

Browse files
authored
🔥 Remove unnecessary HMR client setup (#3241)
1 parent cf25bcd commit 3d87ce1

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

app/setup.php

-29
Original file line numberDiff line numberDiff line change
@@ -46,35 +46,6 @@
4646
])->toHtml();
4747
});
4848

49-
/**
50-
* Add Vite's HMR client to the block editor.
51-
*
52-
* @return void
53-
*/
54-
add_action('enqueue_block_assets', function () {
55-
if (! is_admin() || ! get_current_screen()?->is_block_editor()) {
56-
return;
57-
}
58-
59-
if (! Vite::isRunningHot()) {
60-
return;
61-
}
62-
63-
$script = sprintf(
64-
<<<'JS'
65-
window.__vite_client_url = '%s';
66-
67-
window.self !== window.top && document.head.appendChild(
68-
Object.assign(document.createElement('script'), { type: 'module', src: '%s' })
69-
);
70-
JS,
71-
untrailingslashit(Vite::asset('')),
72-
Vite::asset('@vite/client')
73-
);
74-
75-
wp_add_inline_script('wp-blocks', $script);
76-
});
77-
7849
/**
7950
* Use the generated theme.json file.
8051
*

0 commit comments

Comments
 (0)