Closed johnhungerford closed 6 months ago
I wonder if for all of this it would be enough to do the following:
PackageManager
and ViteRunner
values per sbt
built-in scopes. Would need to have specific cases in mind to make sure that is good enough.PackageManager
and ViteRunner
allow specifying not only command as String
, but arguments as List[String]
also.I think that makes sense, IIUC, and that's how I've done it in sbt-jsbundler (and also here).
In other words, customize all configuration by via bundler and package-manager construction rather than adding a bunch of new settings. I prefer this approach for sure, although I don't see it used very often in plugins.
2. Within
PackageManager
andViteRunner
allow specifying not only command asString
, but arguments asList[String]
also.
This part is also not truly necessary, because custom implementations of PackageManager
and ViteRunner
, that pass additional arguments to commands, can be provided with the current plugin implementation. So it seems that scoping is the only critical part.
I wonder if for all of this it would be enough to do the following:
- Allow scoping
PackageManager
andViteRunner
values persbt
built-in scopes. Would need to have specific cases in mind to make sure that is good enough.- Within
PackageManager
andViteRunner
allow specifying not only command asString
, but arguments asList[String]
also.
Closing because both parts are actually already implemented.
It is important to be able to customize build configurations.
scalajs-bundler
had the ability to specify custom webpack configurations. Insbt-vite
I used a similar but more flexible (but also more complicated) approach of specifying a collectionSeq[sbt.File]
of custom configuration that would be merged in order. This allows sharing configurations between projects but then overriding specific settings per-project.I've also found it useful to be able to update the environment and the arguments for the various commands. For instance, it's necessary to include
NODE_ENV=development
when bundling react projects to ensure that it's bundled with a development react build (this is necessary for tests to work, for instance). I also need (for the time being) to use--legacy-peer-deps
when runningnpm install
.