Module: Bundlebun::Integrations::ViteRuby

Defined in:
lib/bundlebun/integrations/vite_ruby.rb

Overview

An integration for vite-ruby and vite-rails.

For that, we would need both to replace the vite binstub (as bin/vite exists by itself and does not really initialize this gem if it is installed), and redefine the RunnerExtensions for ViteRuby by calling this patch from a Rails initializer. This way, a typical bin/dev would work, as well as integration tests.

Defined Under Namespace

Modules: RunnerExtensions

Class Method Summary collapse

Class Method Details

.bun!Object

Patches the existing module.

Call this after everything is loaded and required. For a Rails application, a good place is an initializer.

See the documentation for more info on installation Rake tasks.



19
20
21
22
23
# File 'lib/bundlebun/integrations/vite_ruby.rb', line 19

def self.bun!
  return unless defined?(::ViteRuby::Runner)

  ::ViteRuby::Runner.prepend(self::RunnerExtensions)
end