hi
I am using Phoenix 1.6, edeliver, mix twailwind and esbuild and trying to use “defaults”.
I need some guidance on a working configuration for edeliver.
mix.exs deps
{:esbuild, "~> 0.2", runtime: Mix.env() == :dev},
{:tailwind, "~> 0.1", runtime: Mix.env() == :dev},
mix.exs alias
"assets.deploy": ["tailwind default --minify", "esbuild default --minify", "phx.digest"]
.deliver/config
__sync_remote "
[ -f ~/.profile ] && source ~/.profile
set -e
cd '$BUILD_AT'
APP='$APP' MIX_ENV='$TARGET_MIX_ENV' $MIX_CMD tailwind default --minify
"
__sync_remote "
[ -f ~/.profile ] && source ~/.profile
set -e
cd '$BUILD_AT'
APP='$APP' MIX_ENV='$TARGET_MIX_ENV' $MIX_CMD esbuild default --minify
"
mix config.exs
config :esbuild,
version: "0.14.0",
default: [
args: ~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets),
# ~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__)}
]
config :tailwind,
version: "3.0.10",
default: [
args: ~w(
--config=tailwind.config.js
--input=css/app.css
--output=../priv/static/assets/app.css
),
cd: Path.expand("../assets", __DIR__)
]
mix tailwind default --minify
works fine, but the mix esbuild default --minify
fails
** (Mix) The task "esbuild" could not be found. Did you mean "hex.build"?
A remote command failed on:
root@buildserver
Output of the command is shown above and the command executed
on that host is printed below for debugging purposes:
FAILED with exit status 1:
[ -f ~/.profile ] && source ~/.profile
set -e
cd '/opt/app/builds'
APP='app' MIX_ENV='prod' mix esbuild default --minify
any guidance would be appreciated, struggling to understand why mix esbuild cannot be found but mix phx.digest and mix tailwind work fine
mix tailwind, esbuild work fine in dev, but when I try prod edeliver I get the error above