Vite โšก๏ธ Rails

Gem Version License

[vite_rails]: https://github.com/ElMassimo/vite_rails [webpacker]: https://github.com/rails/webpacker [vite]: http://vitejs.dev/ [config file]: https://github.com/ElMassimo/vite_rails/blob/main/package/default.vite.json [__Vite Rails__][vite_rails] allows you to use [Vite] to power the frontend. [Vite] is to frontend tooling as Ruby to programming, pure joy! ๐Ÿ˜ ## Features โšก๏ธ - ๐Ÿค– Automatic Entrypoint Detection - โšก๏ธ Hot Reload - โš™๏ธ Rake Tasks - ๐Ÿค Integrated with assets:precompile and friends - And more! (detects changes, and builds automatically if Vite is not running) ## Documentation ๐Ÿ“– A documentation website is coming soon! ## Installation ๐Ÿ’ฟ Add this line to your application's Gemfile: ```ruby gem 'vite_rails' ``` Then, run: ```bash bundle install bin/rake vite:install ``` This will generate configuration files and a sample setup. ## Usage ๐Ÿš€ Drawing inspiration from [webpacker], any files in `app/javascript/entrypoints` will be considered entries to your application (SPAs or pages). These files will be detected, and passed on to Vite, all configuration is done for you. ### Imports โคต๏ธ For convenience, a `~/` import alias is configured to `app/javascript`, allowing you to use absolute paths: ```js import { createApp } from 'vue' import App from '~/App.vue' import '~/channels' createApp(App).mount('#app') ``` ### Tags ๐Ÿท `vite_typescript_tag`, `vite_javascript_tag`, and `vite_stylesheet_tag` can be used to output `