Volt.PluginRunner (Volt v0.8.4)

Copy Markdown View Source

Execute plugin hooks in order, short-circuiting on first match.

Summary

Functions

Run load hooks. Returns {:ok, code, content_type} or nil.

Run render_chunk hooks in sequence.

Run resolve hooks. Returns {:ok, path} or nil.

Run transform hooks in sequence, piping code through each.

Functions

load(plugins, path)

@spec load([module()], String.t()) ::
  {:ok, String.t(), String.t()} | {:ok, String.t()} | nil

Run load hooks. Returns {:ok, code, content_type} or nil.

render_chunk(plugins, code, chunk_info)

@spec render_chunk([module()], String.t(), map()) :: String.t()

Run render_chunk hooks in sequence.

resolve(plugins, specifier, importer)

@spec resolve([module()], String.t(), String.t() | nil) :: {:ok, String.t()} | nil

Run resolve hooks. Returns {:ok, path} or nil.

transform(plugins, code, path)

@spec transform([module()], String.t(), String.t()) :: String.t()

Run transform hooks in sequence, piping code through each.