This is an example project with Phoenix 1.6 that uses npm to manage esbuild and TailwindCSS.
npm is used to manage the dependencies and start the build commands (see package.json
).
It's a more flexible setup than using esbuild
as a mix dependency, like with the default setup.
See reasoning in this great blog post which served as a great starting point.
Another great reference was this blog post.
To start your Phoenix server:
mix deps.get
mix ecto.setup
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.