feat: allow skipping dependencies install. #412
+2
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description 📖
Add an env flag VITE_RUBY_SKIP_INSTALLING_DEPENDENCIES, which lets users skip installing all node dependencies in the install_dependencies rake task. This is similar to the existing VITE_RUBY_SKIP_INSTALLING_DEV_DEPENDENCIES flag.
Background 📜
The reason our team would like this is the following: We are trying to optimize our CI/CD running time and are working at parallelizing as many tasks as we can. We already installed our dependencies in another step and cached them. When we get to the "assets compilation" step, we would like to use those cached dependencies. Unfortunately, in its current state, the vite dependency installation step not only runs the dependency install again, but it also blows away our cache by using
npx ci
(which from our understanding usesnpm ci
in the background).One workaround we found was using the
VITE_RUBY_SKIP_ASSETS_PRECOMPILE_EXTENSION
flag, but that skips the assets' precompilation, which we do want. By using that flag, we can then callbin/rake vite:build_all
. This path is also acceptable, but I thought others might benefit from this flag instead in order to make their own CI setups easier. I've opened this PR both as a discussion forum and as a potential solution in case it's accepted.The Fix 🔨
Added a new flag which skips the
install_dependencies
task.Screenshots 📷