Sha256: d33346c2bd50dbb746a25528eb3d340071c4cee3176b33be33ad1c42356b9e7e

Contents?: true

Size: 966 Bytes

Versions: 18

Compression:

Stored size: 966 Bytes

Contents

# frozen_string_literal: true

require 'rails/railtie'

class ViteRailsLegacy::Engine < Rails::Engine
  initializer 'vite_rails.proxy' do |app|
    app.middleware.insert_before 0, 'ViteRuby::DevServerProxy', ssl_verify_none: true if ViteRuby.run_proxy?
  end

  initializer 'vite_rails_legacy.helper' do
    ActiveSupport.on_load(:action_controller) do
      ActionController::Base.helper(ViteRailsLegacy::TagHelpers)
    end

    ActiveSupport.on_load(:action_view) do
      include ViteRailsLegacy::TagHelpers
    end
  end

  initializer 'vite_rails.logger' do
    config.after_initialize do
      ViteRuby.instance.logger = Rails.logger
    end
  end

  initializer 'vite_rails.bootstrap' do
    if defined?(Rails::Server) || defined?(Rails::Console)
      ViteRuby.bootstrap
      if defined?(Spring)
        require 'spring/watcher'
        Spring.after_fork { ViteRuby.bootstrap }
        Spring.watch(ViteRuby.config.config_path)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
vite_rails_legacy-3.0.5 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-3.0.4 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-3.0.3 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-3.0.2 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-3.0.1 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-3.0.0 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-3.0.0.beta.1 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-2.0.12 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-2.0.11 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-2.0.10 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-2.0.9 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-2.0.8 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-2.0.7 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-2.0.6 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-2.0.5 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-2.0.4 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-2.0.3 lib/vite_rails_legacy/engine.rb
vite_rails_legacy-2.0.2 lib/vite_rails_legacy/engine.rb