Shared path conventions used by Volt.
Summary
Functions
Remember the working directory as the project root. Called when Volt starts.
Expand a path from the project root.
The project root: the working directory when Volt started, or the current one.
Functions
@spec capture_root() :: :ok
Remember the working directory as the project root. Called when Volt starts.
The working directory belongs to the whole VM, and Mix changes it while it
compiles a dependency, as Phoenix.CodeReloader does for a reloadable path
dependency during a request. A relative path resolved in that window lands in
the dependency's directory, so the development server resolves paths from the
root captured here instead.
Expand a path from the project root.
@spec root() :: String.t()
The project root: the working directory when Volt started, or the current one.