polypush135
I’m really liking the way this example app does assent building and watching
https://github.com/wittyprogramming/tailwindcss-alpinejs-starter/blob/master/package.json
At the surface, you will notice that it does not delegate the building or watching of the style sheets to esbuild and instead just defaults to postcss. The more I look at this the more it makes sense.
I know that phoenix needs to have a trigger to tell live reload that something changed.
What issues could I run into if I had multiple watches running simultaneously?
I really want to mimic this asset pipline in my phoenix app. ESbuild is just too fast to ignore for webpack.
Trending in Discussions
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
New
Hey there,
It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
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
Quite interesting article Google brought me. Didn’t find any mentions about it here.
What do you think in general? Would you use togethe...
New
:warning: Security advisory: Decimal DoS vulnerability
A vulnerability has been published for decimal where very large exponents can cau...
New
It would be helpful to have a list of companies worldwide that hire engineers without prior experience in Elixir. Often, it can be quite ...
New
Anyone running long-lived stateful processes on BEAM? We’re building an AI agent runtime and would love to compare notes.
We’re a small ...
New
Other Trending Topics
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
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
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
Aludel - LLM Evaluation Workbench
Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
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
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
kokolegorille
Isn’t it something that can replace webpack?
You might not need both…
I have used multiple watchers without problem. I have one for wasm-pack for example. When I change rust code, it compiles to wasm and reloads the page.
But I could not make it work for multiple instances of the same watcher. I had too many files open error.
I have used 2 bundlers sequentially too, without problem, maybe not really useful.
It was bucklescript, and then webpack
I don’t think it’s a problem to use ESBuild and Webpack, but have never tried.
polypush135
Esbuild can replace webpack.
It would be EsBuild + PostCss
EsBuild for all the JS
And Postcss for the CSS.
My only real concern at the moment for EsBuild is around wasm
mhanberg
I’ve written about this in case you want to take a look: How I Handle Static Assets in my Phoenix apps | Mitchell Hanberg
polypush135
Thank you! I’m gonna read this right now
Noice! the JIT mode + ESBuild. The build times must be so much faster.
polypush135
Question about your post:
Why did you not put your commands in the package.json file and use
npm run?Edit: never mind I forgot there is a legit reason why phoenix does not already do this too.
mhanberg
I will note that since writing this article, I have noticed that
cpxhas a problem with leaving zombie processes.I also noticed that there is a fork,
cpx2, that is more actively maintained. I opened a pull request on that fork to fix the zombie process issue Exit when stdin closes by mhanberg · Pull Request #23 · bcomnes/cpx2 · GitHub, but I am not sure if or when it will be merged.mhanberg
I have also looked into just using the new tailwind cli, but it also has the zombie process issue.
polypush135
Have you seen GitHub - AvianFlu/ncp: Asynchronous recursive file copying with Node.js. · GitHub before? Thinking about giving it a try my self in place of cpx
Edit: ah missed the lacking the watch feature. Prob not the better option
sntran
I’m not sure why we would reinvent
cp -rwith a Node.js version. If a simplecp -rwill do the job, why writing something in another language?As for watching and copying changed files over, a simple Makefile will do the job nicely.
I have pretty much using the combination of Makefile,
tailwindCLI with JIT, and ESBuild.soup
I actually prefer @cnck1387’s method of just letting node handle the watching, but this is my setup from a project without webpack and with elixir watchers:
zombie.shis from Port — Elixir v1.12.3 which fixes the hanging process issues. If you use it, you must run the binaries directly, as shown,npx tailwindcsswon’t work, you’ll end up with zombies still.What I don’t like about this, is having to maintain both separately.
Since
zombie.sh npm run dev:csswill leave you with hanging processes, you must make sure to keep any options in sync between both files (hence why letting node do it all can feel nicer).The hanging process stuff can be particularly painful with tailwind’s jit since it writes incrementally and things tend to get clobbered.