Volt.JS.Asset (Volt v0.14.0)

Copy Markdown View Source

Access to JavaScript and TypeScript support assets bundled with Volt.

Summary

Functions

Read a TypeScript asset, compile to JavaScript, and cache in persistent_term.

Compile a TypeScript support asset after binding OXC $placeholder literals.

Path to the priv/ts directory containing bundled TypeScript assets.

Functions

compiled!(filename)

@spec compiled!(String.t()) :: String.t()

Read a TypeScript asset, compile to JavaScript, and cache in persistent_term.

Returns compiled JS on subsequent calls without recompilation.

compiled_template!(filename, bindings)

@spec compiled_template!(String.t(), keyword() | map()) :: String.t()

Compile a TypeScript support asset after binding OXC $placeholder literals.

path_for(filename)

@spec path_for(String.t()) :: String.t()

priv_dir()

@spec priv_dir() :: String.t()

Path to the priv/ts directory containing bundled TypeScript assets.

read!(filename)

@spec read!(String.t()) :: String.t()