PhoenixAssets.GeneratedFile (PhoenixAssets v0.1.0)

View Source

A single generated frontend-contract file contributed by a plugin.

Plugins return these from PhoenixAssets.Plugin.generated_files/2. The generated engine writes each one to path (relative to the asset root), rewriting only when the contents actually change so the Vite HMR graph is not triggered by no-op writes.

Summary

Functions

Builds a generated file from a keyword list or map of attributes.

Types

kind()

@type kind() ::
  :routes
  | :types
  | :env
  | :electric
  | :pubsub
  | :locales
  | :graph_module
  | atom()

t()

@type t() :: %PhoenixAssets.GeneratedFile{
  contents: iodata(),
  kind: kind() | nil,
  path: Path.t(),
  plugin: atom() | nil
}

Functions

new(attrs)

@spec new(Enumerable.t()) :: t()

Builds a generated file from a keyword list or map of attributes.