niccolox
Edeliver + esbuild working config?
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
Marked As Solved
niccolox
added package.json for esbuild and it worked
for some reason I assumed the esbuild mix handled that dependency or somehow abstracted it
anyway, solved
package.json
"esbuild": "^0.14.10",
Last Post!
niccolox
for completeness, not seeing a package json check or insert esbuild/lib/esbuild.ex at main · phoenixframework/esbuild · GitHub
possibly I got into a bad state, too many changes on for deployment on the new app
server OS is Debian 10
Popular in Questions
Other popular topics
Latest Phoenix Threads
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









