Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Vite in installer #95

Closed
wants to merge 1 commit into from
Closed

Added support for Vite in installer #95

wants to merge 1 commit into from

Conversation

wJoenn
Copy link

@wJoenn wJoenn commented Apr 29, 2023

I figured it wouldn't take too long so in the end I did a first draft today.
I have no idea how to test this in my local environment so it has not been tested, sorry about that.
If you deem it necessary feel free to give me a hint on the procedure and I'll do that

The idea is simple, we check if vite is installed and we store that boolean in a @vite_installed? variable.
We then use that variable to render paths accordingly

The vite_source_code_dir method is used to read the config/vite.json file and grab path to the sourceDir there in case some users have changed that path in their config. It also verifies whether the path includes a closing "/" or not and adds it it's not the case. Again that is to unsure that it wouldn't conflict with different user's config

I created an instances variables instead of methods for @vite_installed? and @vite_source_code_dir because I wanted to avoid reading the file or executing rails vite:verify_install multiple times.

Closes #85

@wJoenn
Copy link
Author

wJoenn commented May 1, 2023

I noticed the installer is still using old inertia packages instead of the ones introduce with Inertia 1.0

I just went through the process of setting up a project for Rails 7 with Vue 3, typescript 5, pinia, eslint, vite 4 and inertia 1 manually so I have a fairly good idea of what needs to be done. I could try to update the generator if you want

@wJoenn wJoenn closed this Oct 21, 2023
@wJoenn wJoenn deleted the installer-update branch October 21, 2023 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vite instead of Webpack
1 participant