ElMassimo / ElMassimo/vite_ruby
Configurable option for location of vite.config.ts
- Dominant language
- Ruby
- Stars
- 1.6k
- Forks
- 149
- Avg merge
- 5h 13m
- Merged PRs (30d)
- 2
Description
**Is your feature request related to a problem? Please describe.**
Yes - a problem in a slightly idiosyncratic setup we're looking at.
**Describe the solution you'd like**
We're setting up a frontend microservice within an existing Rails project running a legacy Webpacker setup. As we look to update our stack, we're setting up a subfolder from the Rails root, running its own package.json and built using Vite.
The challenge here is (please correct me if I'm mistaken!) there's no option to specify the location of the `vite.config.ts` file. With our new structure, if we keep this file at the root level, it has incorrect dependencies ascertained from the legacy setup. If we move it to the subfolder, there's no way for `vite_ruby` to change where it looks for this.
I've managed to very scrappily patch your gem locally to accept a `--js-config-path` argument specifying the nested `vite.config.ts` location, and all works pretty well. (Happy to share if you're interested, but it really is crude work designed to see if this were a possibility.)
It would be lovely if this functionality were built in, perhaps by using either a config argument and / or an ENV variable.
**Describe alternatives you've considered**
We've hit dependency hell, hence our unorthodox approach. The alternatives would be a *major* change to upgrade everything at once, or to use a frontend build tool independent of Rails and handle the new microservice manually.
Thanks for the time reading through this - let me know if you've any questions, advice, etc. :)
Contributor guide
Assessment
This issue has not been assessed yet.