Skip to main content

inject_dev_hmr_into_html

Function inject_dev_hmr_into_html 

Source
pub fn inject_dev_hmr_into_html(html: &str, hmr_endpoint: &str) -> String
Expand description

Injects the dev-only SSE hot-reload script right before </body> in an HTML document.

§Arguments

  • &str - Original HTML source string.
  • &str - SSE HMR endpoint URL path.

§Returns

  • String - HTML document containing the live-reload client snippet.