Menu

From Vite to Propshaft + esbuild: Simplifying a Rails Asset Pipeline
πŸ“°

From Vite to Propshaft + esbuild: Simplifying a Rails Asset Pipeline

DEV Community: esbuildΒ·Juan VasquezΒ·10 days ago
#duWl1Vf8
#devtoesbuild#devto#dev#rails#vite
Reading 0:00
15s threshold

The Problem

My Rails app was running Vite. It worked: HMR in development, fingerprinted assets in production, Tailwind through PostCSS. But Vite is a JavaScript tool that happens to serve a Rails app. The vite_rails gem, vite.config.ts , config/vite.json , a separate dev server on port 3036, all to do what Rails can do natively.

I wanted to simplify toward a zero-Node future, where the app is pure Ruby in production. Not because Node is bad, but because every dependency is a liability, and this app doesn’t need a JavaScript build tool to serve server-rendered HTML with Turbo and Stimulus.

The question was: can I get there without rewriting everything at once?

The Journey: Sprockets β†’ Vite β†’ Propshaft + esbuild β†’ Importmaps

This is actually the third asset pipeline this app has used.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.