Vite โก๏ธ Rails
[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 `