The host's own asset pipeline.
For libraries whose templates are styled by the host's Tailwind and whose
JavaScript hooks the host registers. The library serves no files: its
LiveViews usually render inside the host's root layout (layout: :host),
which already loads the host's CSS and JavaScript.
use PhoenixMountable,
otp_app: :my_lib,
macro: :my_lib,
layout: :host,
assets: {PhoenixMountable.Assets.Host, []}The host tells Tailwind to scan the library's templates. With Tailwind v4
(Phoenix 1.8), in assets/css/app.css:
@source "../../deps/my_lib";With Tailwind v3 (Phoenix 1.7), in assets/tailwind.config.js:
content: [
// ...
"../deps/my_lib/**/*.*ex"
]tailwind_source/2 returns the right line, and
PhoenixMountable.Igniter.add_tailwind_source/2 adds it for the host.
Options
:entries— host asset paths to expose as entries, for a library that renders its own layout but loads the host's files, such as[css: "/assets/css/app.css", js: "/assets/js/app.js"]. URLs go through the endpoint's static path, so they carry the digest in production. Defaults to[].
Summary
Functions
The line that makes the host's Tailwind scan a library's templates.