Jayshua
How does esbuild find Phoenix.js?
I was exploring the new esbuild system in Phoenix. The documentation suggests that the two ways to import third-party libraries are by putting them in a vendor folder or by using npm install. However, the app generated by phx.new doesn’t appear to do either of those when importing the phoenix & phoenix liveview js. (Although it does use the first method to import the topbar library.)
Based on the output js file, it looks like esbuild is finding the js libraries in the deps directory, but I haven’t been able to find any config or code telling esbuild to look there.
How does this work?
Marked As Solved
josevalim
Also Liked
josevalim
We also set an environment variable in the esbuild config pointing to Elixir deps folder, and esbuild also looks for files in there. I am on my phone but I can give a full reference tomorrow.
josevalim
Yes, correct.
Popular in Questions
Other popular 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
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








