Sha256: 57d837793dabc9296ee31a400b3cfba3f09b44d24c77f51524a24a7be40212bf

Contents?: true

Size: 1.1 KB

Versions: 13

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

require 'rails/railtie'

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

  initializer 'vite_rails.helper' do
    ActiveSupport.on_load(:action_controller) do
      ActionController::Base.helper(ViteRails::Helper)
    end

    ActiveSupport.on_load(:action_view) do
      include ViteRails::Helper
    end
  end

  initializer 'vite_rails.logger' do
    config.after_initialize do
      ViteRails.logger = if ::Rails.logger.respond_to?(:tagged)
                           ::Rails.logger
                         else
                           ActiveSupport::TaggedLogging.new(::Rails.logger)
                         end
    end
  end

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
vite_rails-1.0.12 lib/vite_rails/engine.rb
vite_rails-1.0.11 lib/vite_rails/engine.rb
vite_rails-1.0.10 lib/vite_rails/engine.rb
vite_rails-1.0.9 lib/vite_rails/engine.rb
vite_rails-1.0.8 lib/vite_rails/engine.rb
vite_rails-1.0.7 lib/vite_rails/engine.rb
vite_rails-1.0.6 lib/vite_rails/engine.rb
vite_rails-1.0.5 lib/vite_rails/engine.rb
vite_rails-1.0.4 lib/vite_rails/engine.rb
vite_rails-1.0.3 lib/vite_rails/engine.rb
vite_rails-1.0.2 lib/vite_rails/engine.rb
vite_rails-1.0.1 lib/vite_rails/engine.rb
vite_rails-1.0.0 lib/vite_rails/engine.rb