# `Volt.Watcher`
[🔗](https://github.com/elixir-volt/volt/blob/v0.22.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 of templates and content that
    Volt does not compile. A change asks open pages to revalidate their
    HTML and reload if it changed; see `Volt.HMR.Document`
  * `:watch_ignored` — paths or glob patterns excluded from watcher events
    (default: common VCS, dependency, test-output, cache, and build directories)
  * `:tailwind` — enable Tailwind CSS rebuilds (default: `false`)
  * `:tailwind_css` — custom Tailwind input CSS (default: Tailwind base)
  * `:tailwind_sources` — source globs scanned for Tailwind candidates
  * `:tailwind_name` — logical Tailwind output name (default: input basename)
  * `:tailwind_url` — browser URL broadcast for Tailwind style updates
  * `: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*
