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

force ssr build when VITE_RUBY_SSR_BUILD_ENABLED=true #484

Closed luca-peruzzo closed 1 month ago

luca-peruzzo commented 1 month ago

Description 📖

This pull request fixes #483

Background 📜

This was happening because you need to force ssr build

The Fix 🔨

By changing ViteRuby.commands.build_from_task('--ssr') if ViteRuby.config.ssr_build_enabled to ViteRuby.commands.build_from_task('--ssr', '--force') if ViteRuby.config.ssr_build_enabled

ElMassimo commented 1 month ago

Hi Luca!

The SSR build uses a different file to track whether the last build is stale or not.

Forcing the build would defeat the purpose of caching.

ElMassimo commented 1 month ago

Closing as caching SSR builds is intentional behavior.