Skip to content

Commit d2845b4

Browse files
committed
🔥 Remove unnecessary HMR client setup
1 parent da70c86 commit d2845b4

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

app/setup.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -49,35 +49,6 @@
4949
])->toHtml();
5050
});
5151

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

0 commit comments

Comments
 (0)