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
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
I’m trying to set up Emacs with elixir-ls via lsp-mode and credo via Flycheck. This should mostly be preconfigured as Flycheck picks up c...
New
Other Trending Topics
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
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
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
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










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.