BunBundle.ReloadTag (bun_bundle v0.1.1)

Copy Markdown View Source

Renders the live reload client script for development.

Connects to Bun's WebSocket dev server for CSS hot-reloading (without a full page refresh) and full page reloads on JS or image changes. Preserves the window scroll position across reloads.

Returns an empty string outside the :dev environment, so it can be called unconditionally from a layout:

<%= BunBundle.ReloadTag.tag() %>

When Phoenix.HTML is available, the result is marked safe so Phoenix templates do not escape it. Otherwise it is a plain string and callers must handle escaping (e.g. raw/1).

Summary

Functions

Returns the live reload <script> tag, or an empty string in non-dev.

Functions

tag()

Returns the live reload <script> tag, or an empty string in non-dev.