Skip to content

This project shows how to build an application with both Rails and Vite.js in the same repo.

License

Notifications You must be signed in to change notification settings

guillaumebriday/rails-vitejs

Repository files navigation

Rails and Vite.js

Concept Overview

This project shows how to build an application with both Rails and Vite.js in the same repo.

It does not use the Rails gem Webpacker to manage JavaScript and CSS. It's fully delegated to Vite.js.

How it works

During development, we don't need to build assets, so we are using the Vite.js server on port 3001.

In production, we need to build assets in the public folder with yarn build command.

To prevent conflicts with the public folder, I changed the Vite.js root option in the vite.config.js file.

Getting started

Install

Development environment requirements :

$ git clone https://github.com/guillaumebriday/rails-vitejs.git && cd rails-vitejs

To run the backend

$ bundle
$ bundle exec rails s

To run the Frontend:

$ yarn
$ yarn dev

Open http://localhost:3000 in your browser.

Contributing

Do not hesitate to contribute to the project by adapting or adding features ! Bug reports or pull requests are welcome.

License

This project is released under the MIT license.

About

This project shows how to build an application with both Rails and Vite.js in the same repo.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published