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

Allow . as a valid option for sourceCodeDir #425

Open
davidmyersdev opened this issue Dec 12, 2023 · 0 comments
Open

Allow . as a valid option for sourceCodeDir #425

davidmyersdev opened this issue Dec 12, 2023 · 0 comments

Comments

@davidmyersdev
Copy link

Is your feature request related to a problem? Please describe.

My team uses a mono-repo setup that uses Packwerk. We have various packs at paths such as ./packs/<package> and under those packs can be frontend assets at ./packs/<package>/app/frontend. These packs reside next to a traditional top-level Rails app which hosts assets at ./app/frontend. These all share a common configuration for Vite Ruby, and that means we would ideally set our sourceCodeDir to . so that all paths can be made relative to the root of the project. This seems to work just fine, but the default glob that is assigned to sourceCodeDir means that all files (./**/*) are scanned by Vite Ruby. This leads to long wait times for commands that trigger Vite Ruby to scan all files (e.g. the bin/vite build command).

Describe the solution you'd like

I'd like to be able to override the default file globs so that I can set the sourceCodeDir to ..

Describe alternatives you've considered

Currently, I set it up so that I have a default sourceCodeDir of ./app/frontend with the others added to additionalEntrypoints and watchAdditionalPaths. The problem with this approach is that the Vite root ends up getting set to ./app/frontend and I have to configure Vitest along with various plugins relative to that path even when the tests are not in the root project. It leads to confusing configurations if you are not aware of what Vite Ruby is doing behind the scenes.

Additional context

N/A

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

No branches or pull requests

1 participant