# `Volt.Watcher`
[🔗](https://github.com/elixir-volt/volt/blob/v0.16.0/lib/volt/watcher.ex#L1)

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. Files added to or removed from
`import.meta.glob()` patterns invalidate the module that owns the glob.

## 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)
  * `:reload_dirs` — additional directories whose changes trigger a full
    browser reload without being compiled by Volt
  * `: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

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
