-
Notifications
You must be signed in to change notification settings - Fork 752
Example Rails 7 project with esbuild, SSR and Tailwind CSS #1308
-
Hi all!
I've been thinking of giving this gem a shot for a new project I'm working on, so I decided to dive in and set it all up myself! I'm pretty happy about the result and how straightforward react-rails
is for server-side rendered React, so I'm going to share this:
⬆️ This is the example project, and I've added some notes about what's being used.
Initially, I wanted to try to get it up and running with Vite, but encountered some weird issues with the vite-ruby
gem, so I went for esbuild (via jsbundling-rails
) instead, which is just as good (and standard now) for new Rails apps. Anything is better than Webpack in the end, and I'm glad I didn't have to fall back to it this time.
I'm open to questions and suggestions on how to improve it.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 5
Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
All reactions
-
@naft-a
- did you give https://github.com/shakacode/react_on_rails a try as well?
- Why do you say:
ruby gem, so I went for esbuild (via jsbundling-rails) instead, which is just as good (and standard now) for new Rails apps. Anything is better than Webpack in the end
Shakapacker supports https://github.com/shakacode/shakapacker#esbuild-loader-configuration.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Hi @justin808
- Nope, I did not but may spin up a new project to try that one out!
- Mostly because I had bad experience with
webpack
in the past - being too flexible also made it too complicated and I just don’t care enough to really understand it. As forshakapacker/webpacker
- I just wanted to have that setup as close as possible to the rails defaults which happens to bejsbundling-rails
🤷🏽
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1