zoten / phx_elm

Simple test to see a Phownix 1.6 + Elm + Tailwind setup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PhxElm

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.setup
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Changes until now

See also

  • cd assets
    npm install esbuild --save-dev
    npm install esbuild-plugin-elm --save-dev
    
    npm install ../deps/phoenix ../deps/phoenix_html ../deps/phoenix_live_view --save
  • # config.exs
    
    # Comment out esbuild config
    # config :esbuild,
  • Create assets/build.json

  • Create assets/src/Main.elm

  • # dev.exs
    
    config :phx_elm, PhxElmWeb.Endpoint,
     # ...
     watchers: [
       # Start the esbuild watcher by calling Esbuild.install_and_run(:default, args)
       # esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]}
       node: ["build.js", "--watch", cd: Path.expand("../assets", __DIR__)]
     ]
  • tailwind support, see commit

About

Simple test to see a Phownix 1.6 + Elm + Tailwind setup


Languages

Language:Elixir 68.9%Language:CSS 21.1%Language:JavaScript 5.8%Language:HTML 2.0%Language:Elm 2.0%Language:Shell 0.1%