Tasuku_Sai
“esbuild” will bundle, properly, javascript files only, for on its website it says that there may be problems with bundling css files.
Does bundling js files save that much traffic so that it’s worth it to use the tool?
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m aware of 2 such projects, are there others?
git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
Hi all,
I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
Hi everyone.
My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
Hi,
we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
Hi all, I’m new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley:
Mutonex gamedesign was finish...
New
Do we have maintainer of absinthe-graphql/dataloader here? We have a PR that we’d like to merge to the library. Relatively small additive...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #ecto-query
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #hex










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
50kudos
The main benefits right now are tree-shaking, minification, and single (or a few) bundled file caching (browser does that, so it tends to load once per version). Esbuild can build css as entry point without any other config options, I haven’t seen any problem with css building.
It’s worth it for now, browser capability around this is improving (e.g. import map). Honestly esbuild config is really simple compared to js-based bundler.
Tasuku_Sai
What’s tree-shaking?
The browser is capable of caching 1 file as well as 5 ones. What’s the difference?
You haven’t listed any beneftis of using the tool in the first place. “It’s easy to use therefore one should use it”. What for? How about downsides?
derek-zhou
It really depends how much js you have. If I only use Phoenix Liveview and a bit of js I wrote, I don’t bundle. If I need to use a js framework for a project, I bundle.
Don’t trust words, benchmark yourself.
thiagomajesk
I think you perhaps have misunderstood the explanation for lack of context. This community has kind of a history with javascript build tools. We used to use Brunch, then Webpack and now we are using Esbuild, which is really simple to configure and use compared to existing options in the market. The decision to replace Webpack with Esbuild has been documented on the forums (if you are interested). For further explanations that are not just subjective opinions, I think it would actually be productive if you tried configuring the other tools and making the decisions if it’s worth it on your own.
It depends on the project’s asset delivery strategy… You still can deliver a huge bundle that the browser will cache and only redownload once a month or deliver lots of small files that are cached and change frequently. It really depends, there’s no “right” answer here. I encourage you to read a little bit more on those strategies to make it more clear how those different tools might help you.
benwilson512
You can also use GitHub - CargoSense/dart_sass: Install and run Dart Sass using Elixir. · GitHub combined with
esbuildto get sass without webpack.Kurisu
Yes I just followed a tutorial on setting up
CargoSense dart_sassto enable bootstrap and fontawesome with a phoenix 1.6 project.The only downside of dropping webpack I have for now is that with CargoSense dart_sass, I have to manually copy fonts to “priv/static/…” when they are referenced in imported css/sass files. The issue is reported on the github here: Images and fonts are missing from node_modules css files that use url('...') · Issue #22 · CargoSense/dart_sass · GitHub.
I don’t want to make a big deal out of this, but just in case there would be simple workarounds, I would take it. ^^
carterbryden
One solution I’ve found that I like because I haven’t had to adjust it is to just chain specialized build tools together.
For instance:
The configs are all super short and easy to read, run in milliseconds, and adding new front end packages is still just npm install.
I wonder if you could chain dart_sass and esbuild in some simple way that would being the fonts in for you?
Kurisu
Thank you for sharing your solution. I like it too. ^^
Yes that would be great, but for now I don’t have sufficient knowledge with those tools and I will just keep manually copying the needed fonts for imported sass styles. Otherwise I found dart_sass config very easy and straightforward.
Daan.T
esbuild is the pi π of build tools, simple, fast, and essential for phoenix projects.