Svelixir.Config.Web (svelixir v0.11.0)

Copy Markdown

The :web project preset — priv/templates/base_web_app.exs as code.

new!/0 returns exactly what that template describes. Measured against base_otp_app.exs, the whole difference is four values: project.type, assets.type, and the two assets.ui flags. Everything else — cache, features, auth, security, container — is identical in both files, which is why there is one struct and two presets rather than two structs.

Setting project.type: :web alone would not reproduce the template: it is the assets selection that makes a web project actually serve anything.

This is a builder, not a struct. It returns %Svelixir.Config{}; there is no %Svelixir.Config.Web{}.

Summary

Functions

Builds a :web config, with overrides merged over the preset.

The values this preset supplies, before any override.

Functions

new!(overrides \\ [])

@spec new!(keyword() | map()) :: Svelixir.Config.t()

Builds a :web config, with overrides merged over the preset.

Overrides recurse to the leaf, so new!(assets: [type: :both]) keeps the preset's ui flags rather than replacing the whole assets section with a block that has LiveView switched off.

preset()

@spec preset() :: keyword()

The values this preset supplies, before any override.