mix phx.new tls --verbose --no-install --database postgres --adapter bandit --no-install --no-gettext --no-ecto --no-mailer
{:live_svelte, "~> 0.13"}
defp aliases do
[
setup: ["deps.get", "assets.setup", "assets.build"],
"assets.setup": ["tailwind.install --if-missing", "cmd --cd assets npm install"],
"assets.build": ["tailwind tls", "cmd --cd assets node build.js"],
"assets.deploy": [
"tailwind tls --minify",
"cmd --cd assets node build.js --deploy",
"phx.digest"
]
]
end
mix live_svelte.setup
import LiveSvelte
增加到文件 /lib/<app_name>_web.ex
的 html_helpers/0
中"./svelte/**/*.svelte"
to content
in the tailwind.config.js
filemix setup
cd assets && npm install tailwind-variants clsx tailwind-merge lucide-svelte
npm install -D typescript
svelte/utils.ts
components.json
by npx shadcn-svelte@latest init
tailwind.config.js
css/app.css
npx shadcn-svelte@latest add button