niccolox

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

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

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

Where Next?

Popular in Questions Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

Other popular topics Top

jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42533 114
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement