Serum.Plugins.LiveReloader (serum v1.5.1) View Source
A Serum plugin that injects the live reloader script at the end of HTML files.
Once the page is loaded inside your web browser, the injected script tries to connect to the Serum development server via WebSocket. When the page receives "reload" message from the server, it refreshes the current page.
If you disable this plugin, you need to manually refresh the page after you made some changes to your source files.
Using the Plugin
You usually don't want the script injected into pages when the Serum
development server is not running. Let the plugin run only when Mix.env()
is dev
, and run MIX_ENV=prod mix serum.build
when you are about to
publish your website.
# serum.exs:
%{
plugins: [
{Serum.Plugins.LiveReloader, only: :dev}
]
}
Link to this section Summary
Functions
Callback implementation for Serum.Plugin.description/0
.
Callback implementation for Serum.Plugin.elixir/0
.
Callback implementation for Serum.Plugin.implements/0
.
Callback implementation for Serum.Plugin.name/0
.
Callback implementation for Serum.Plugin.rendered_page/2
.
Callback implementation for Serum.Plugin.serum/0
.
Callback implementation for Serum.Plugin.version/0
.
Link to this section Functions
Callback implementation for Serum.Plugin.description/0
.
Callback implementation for Serum.Plugin.elixir/0
.
Callback implementation for Serum.Plugin.implements/0
.
Callback implementation for Serum.Plugin.name/0
.
Callback implementation for Serum.Plugin.rendered_page/2
.
Callback implementation for Serum.Plugin.serum/0
.
Callback implementation for Serum.Plugin.version/0
.