ElMassimo / vite_ruby

⚡️ Vite.js in Ruby, bringing joy to your JavaScript experience
https://vite-ruby.netlify.app/
MIT License
1.28k stars 117 forks source link

feat: allow skipping dependency install in assets:precompile #451

Closed josephnle closed 3 months ago

josephnle commented 5 months ago

Description 📖

We want to use the assets:precompile extension but we don't want it to install dependencies. This allows setting VITE_RUBY_SKIP_ASSETS_PRECOMPILE_INSTALL=true to skip installation while keeping the rest of the task extensions.

Background 📜

This was happening because dependencies are always installed (yarn install / npx ci) as part of the assets:precompile extension.

The Fix 🔨

Add conditional controlled by VITE_RUBY_SKIP_ASSETS_PRECOMPILE_INSTALL to allow for skipping the installation task.

ElMassimo commented 3 months ago

Hi Joseph!

This has been requested enough times that I feel it justifies adding, especially given that it's not unusual for node_modules to be installed in a previous layer when creating Docker images.

Thanks!