Current section
14 Versions
Jump to
Current section
14 Versions
Compare versions
4
files changed
+18
additions
-6
deletions
| @@ -21,7 +21,7 @@ A PoC for single-file components for [Phoenix](https://www.phoenixframework.org) | |
| 21 21 | ```elixir |
| 22 22 | def deps do |
| 23 23 | [ |
| 24 | - {:svx, "~> 0.1.4"} |
| 24 | + {:svx, "~> 0.1.5"} |
| 25 25 | ] |
| 26 26 | end |
| 27 27 | ``` |
| @@ -46,8 +46,20 @@ config :your_app, YourAppWeb.Endpoint, | |
| 46 46 | reloadable_compilers: [:svx] |
| 47 47 | ``` |
| 48 48 | |
| 49 | - 4. Add `@import "./generated.css";` to `assets/css/app.css` |
| 50 | - 5. Create your views as `.lsvx` files anywhere in `lib` |
| 49 | + 4. In `config/dev.exs` set Phoenix to live-reload your templates: |
| 50 | + |
| 51 | + ```elixir |
| 52 | + config :your_app, YourAppWeb.Endpoint, |
| 53 | + live_reload: [ |
| 54 | + patterns: [ |
| 55 | + #... |
| 56 | + ~r"lib/your_app_web/(live|views)/.*(svx)$" |
| 57 | + ] |
| 58 | + ] |
| 59 | + ``` |
| 60 | + |
| 61 | + 5. Add `@import "./generated.css";` to `assets/css/app.css` |
| 62 | + 6. Create your views as `.lsvx` files anywhere in `lib/your_app_web` |
| 51 63 | |
| 52 64 | ## How to |
| @@ -26,4 +26,4 @@ | |
| 26 26 | {<<"optional">>,false}, |
| 27 27 | {<<"repository">>,<<"hexpm">>}, |
| 28 28 | {<<"requirement">>,<<"~> 0.17.5">>}]]}. |
| 29 | - {<<"version">>,<<"0.1.4">>}. |
| 29 | + {<<"version">>,<<"0.1.5">>}. |
| @@ -41,7 +41,7 @@ defmodule Svx.Compiler do | |
| 41 41 | parsed = collect_content(content, template_with_path) |
| 42 42 | |
| 43 43 | module = """ |
| 44 | - defmodule SvxWeb.#{module_name} do |
| 44 | + defmodule #{module_name} do |
| 45 45 | use Phoenix.LiveView |
| 46 46 | |
| 47 47 | #{parsed.module} |
| @@ -5,7 +5,7 @@ defmodule Svx.MixProject do | |
| 5 5 | [ |
| 6 6 | app: :svx, |
| 7 7 | name: "Svx", |
| 8 | - version: "0.1.4", |
| 8 | + version: "0.1.5", |
| 9 9 | description: "A PoC for single-file components for Phoenix LiveView", |
| 10 10 | elixir: "~> 1.12", |
| 11 11 | start_permanent: Mix.env() == :prod, |