I have a Rails 6 app and I want use Svelte on client side only
I have nodeJS, NPM and Yarn installed.
Now, how can I install Svelte to this app without webpack, only using sprocket ?
I have a Rails 6 app and I want use Svelte on client side only
I have nodeJS, NPM and Yarn installed.
Now, how can I install Svelte to this app without webpack, only using sprocket ?
Copyright © 2021 Jogjafile Inc.
You could use jsbundling by adding the gem and then you have your choice of esbuild, rollup, or webpacker.
This article summarizes it well: https://anonoz.github.io/tech/2021/12/11/rails-tailwindcss-svelte.html
Another resource for jsbundling: https://github.com/rails/jsbundling-rails
The other option would be start with Rails 7 and declare esbuild from the beginning. Then you can just use Yarn to add Svelte to the project.