Has anyone used lazy loading in a phoenix live view project?

This is the second best thread that come up from search on the topic, so reviving it with an up-to-date solution for the benefit of all.

On a modern Phoenix LiveView app, I was able to keep the app.js bundle small while adding a heavy JS dependency needed only in a single LiveView page. Here’s the report on how to do it with esbuild, code-splitting and ESM dynamic imports: