vite_ruby can be used in plain Rack apps, and is all you need when using HTML entrypoints.
Why Vite? 🤔
Vite does not bundle your code during development, which means the dev server is extremely fast to start, and your changes will be updated instantly.
In production, Vite bundles your code with tree-shaking, lazy-loading, and common chunk splitting out of the box, to achieve optimal loading performance.
It also provides great defaults, and is easier to configure than similar tools like webpack.
Why Vite Ruby? 🤔
Vite is great on its own, but configuring it correctly to work for a Ruby app structure requires knowledge of its internals.
Interested in hearing more? Read about my personal motivation.
Everything Vite provides, plus:
🤖 Automatic entrypoint detection
⚡️ Lightning-fast hot reload
Because it does not bundle your code in development, only the scripts and styles that are running need to be processed, which enables Vite to have significantly faster HMR than webpack.
🚀 Integrated with assets:precompile
🏗 Auto-build when not running Vite
When the development server is not running, it will automatically detect changes and recompile assets for you. Makes it seamless to run integration tests.
🏷 Smart tag helpers
Tag helpers for script and link tags are provided, and will automatically output
preload tags in production to optimize load time.