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
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication):
toke...
New
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
New
** (ArgumentError) expected :max_attempts to be a positive integer, got: {:@, [line: 10, column: 19], [{:max_attempts, [line: 10, column:...
New
Hello folks!
So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
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
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
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
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #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.