Closed acco closed 8 months ago
Hi Anthony,
Very cool to hear you're interested in adopting LiveSvelte for your team!
Basically what happens during the setup is we go from using the standard Elixir esbuild
package to using esbuild
directly as a node_module
. The standard Elixir esbuild
package works great for simple projects with phoenix hooks, but to use LiveSvelte we need a more complex setup.
From the official docs: https://hexdocs.pm/phoenix/asset_management.html#esbuild-plugins
Phoenix's default configuration of esbuild (via the Elixir wrapper) does not allow you to use esbuild plugins. If you want to use an esbuild plugin, for example to compile SASS files to CSS, you can replace the default build system with a custom build script.
That's basically what's going on here. LiveSvelte follows the official documentation in this regard and that's by design.
The standard Elixir esbuild
watcher is no longer needed as we create a new watcher that does the same thing:
node: ["build.js", "--watch", cd: Path.expand("../assets", __DIR__)]
Let me know if that makes sense or things are still unclear, happy to explain more!
Also, PR's are welcome as you said to improve the documentation :)
@woutdp Thank you, totally makes sense! Your response really cleared things up for me, so I weaved it into the docs – take or leave :)
Hey there,
This looks promising! Our team wants to adopt, but we're having trouble understanding what exactly is going on in the installation. For example, the guide mentions that the esbuild watcher is no longer needed - but we'd like to understand why?
Essentially, laying out "what we just did" in even more detail so folks like us can adopt and feel informed about the impact of the decision.
I'm happy to open a PR for the README if you provide the brief details!
Thanks, Anthony