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

Include multiple resources directories #42

Open
johnhungerford opened this issue Feb 6, 2024 · 2 comments
Open

Include multiple resources directories #42

johnhungerford opened this issue Feb 6, 2024 · 2 comments

Comments

@johnhungerford
Copy link

It would be useful to specify multiple directories in viteResources for a couple reasons:

  1. For projects like my own that are broken up into multiple sub-projects, it is useful to be able to import common source directories in addition to project-specific ones
  2. It allows using the scala directory structure for other source types without having to specify a common parent directory which includes Scala source code. E.g.,
├── build.sbt
├── project
├── vite-resources
│    ├── package.json
│    ├── package-lock.json
│    ├── index.html
│    ├── main.js
│    └── public
│         └── logo.png
└── src
     ├── main
     │     ├── javascript
     │     ├── scala
     │     └── styles
     └── test
           └── scala

In the above directory structure, we would want to include vite-resources, src/main/javascript, and src/main/styles without also including a bunch of other things.

@ptrdom
Copy link
Owner

ptrdom commented Feb 6, 2024

I can see how this is useful, and it should be quite easy to implement. I think we can proceed with it if we keep it as simple as possible - that is just have viteResourcesDirectories as SettingKey[Set[sbt.File]] and just loop over those and call copyChanges in viteCopyResources. If we want more than that, then viteCopyResources probably needs to start using fileInputs.

@johnhungerford
Copy link
Author

Agreed, but I recommend using Seq instead of set, as the order of copying may matter (e.g., if you intend to overwrite certain files with the same name)

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

2 participants