Volt.Watcher (Volt v0.8.4)

Copy Markdown View Source

File watcher that triggers recompilation, Tailwind rebuilds, and HMR updates.

Monitors source directories for changes, recompiles affected JS/Vue/CSS files through the Pipeline, triggers Tailwind CSS rebuilds when template files change, and broadcasts updates to connected HMR clients.

When a JS/TS/Vue file changes, the watcher attempts to find an HMR boundary (a module with import.meta.hot.accept()) by walking up the dependency graph. If found, only that module is re-imported by the client. Otherwise, a full page reload is triggered.

Options

  • :root — asset source directory (required, e.g. "assets")
  • :watch_dirs — additional directories to watch for Tailwind scanning (e.g. ["lib/"] for .ex/.heex templates)
  • :tailwind — enable Tailwind CSS rebuilds (default: false)
  • :tailwind_css — custom Tailwind input CSS (default: Tailwind base)
  • :target — JS downlevel target
  • :import_source — JSX import source
  • :vapor — Vue Vapor mode

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)