chore: simplify esbuild config, fix hot reload

This commit is contained in:
Ivan R. 2024-08-31 13:42:05 +05:00
parent 80743a50f7
commit cc57bddc24
Signed by: lumin
GPG key ID: E0937DC7CD6D3817
2 changed files with 2 additions and 8 deletions

View file

@ -38,12 +38,7 @@ config :esbuild,
version: "0.17.11",
comfycamp: [
args:
~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
cd: Path.expand("../assets", __DIR__),
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
],
css: [
args: ~w(css/home.css css/admin.css --outdir=../priv/static/assets),
~w(js/app.js css/home.css css/admin.css --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
cd: Path.expand("../assets", __DIR__),
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
]

View file

@ -70,10 +70,9 @@ defmodule Comfycamp.MixProject do
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
"assets.setup": ["esbuild.install --if-missing"],
"assets.build": ["esbuild comfycamp", "esbuild css"],
"assets.build": ["esbuild comfycamp"],
"assets.deploy": [
"esbuild comfycamp --minify",
"esbuild css --minify",
"phx.digest"
]
]