msw10100
I have an umbrella app with an existing Phoenix app inside. I want to add another phoenix app, listening on a different port.
I ran mix phx.new.web internal_ui --no-ecto --no-mailer from the apps folder of my umbrella to generate the app. All looked good. I changed the port to 4001 for the new app.
However, I noticed that when I built and ran my application, my assets for the new app did not get built. No app.js. No app.css. No minified or gzipped files.
Looking deeper, I see that there are two config :esbuild entries in the config.exs, and the one for the new app is first. Won’t the configuration for the second overwrite the first? When I move the esbuild config for the new app below the one for the original web app, my app.js does get built in the priv/static of my new app, but no CSS files get built.
How can I get my priv/static files to build for multiple Phoenix apps?
Trending in Questions
Other Trending Topics
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
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex











Showing Posts 1 to 2- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
msw10100
Okay, I’ve got this one figured out after reading this StackOverflow post. It’d be awesome if the phx.new.web generator could figure this one out, or perhaps detect the condition and give the developer a clue as to how to proceed.
The generated esbuild and tailwind configs both have a
defaultprofile. The new web app requires a different profile under the existingconfig :esbuildandconfig :tailwindkeys, with a name other thandefault.For example:
and
Then, back in the
dev.exsconfig, you have to edit the generatedwatcherskey, replacingdefaultwith the key you specified in thetailwindandesbuildconfigs for the new profile.If anyone knows of anything else that needs to be done, please reply with additions.
Cheers!
msw10100
[deleted]