class ViteRuby
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/vite_ruby.rbs class ViteRuby def config: () -> ViteRuby::Config def manifest: () -> untyped end
def bootstrap
def bootstrap instance.manifest.refresh end
def builder
def builder @builder ||= ViteRuby::Builder.new(self) end
def commands
def commands @commands ||= ViteRuby::Commands.new(self) end
def config
Experimental RBS support (using type sampling data from the type_fusion
project).
def config: () -> ViteRuby::Config
This signature was generated using 2 samples from 1 application.
def config unless defined?(@config) configure @config.load_ruby_config end @config end
def configure(**options)
def configure(**options) @config = ViteRuby::Config.resolve_config(**@config_options, **options) end
def dev_server_running?
Public: Returns true if the Vite development server is currently running.
def dev_server_running? return false unless run_proxy? return @running if defined?(@running) && Time.now - @running_checked_at < 1 begin Socket.tcp(config.host, config.port, connect_timeout: config.dev_server_connect_timeout).close @running = true rescue StandardError @running = false ensure @running_checked_at = Time.now end end
def digest
Public: Returns a digest of all the watched files, allowing to detect
def digest builder.send(:watched_files_digest) end
def env
Example:
Public: Additional environment variables to pass to Vite.
def env @env ||= ENV.select { |key, _| key.start_with?(ENV_PREFIX) } end
def framework_libraries
Internal: Detects if the application has installed a framework-specific
def framework_libraries COMPANION_LIBRARIES.map { |name, framework| if library = Gem.loaded_specs[name] [framework, library] end }.compact end
def initialize(**config_options)
def initialize(**config_options) @config_options = config_options end
def install_tasks
def install_tasks load File.expand_path('tasks/vite.rake', __dir__) end
def instance
def instance @instance ||= new end
def logger
def logger @logger ||= Logger.new($stdout) end
def manifest
Experimental RBS support (using type sampling data from the type_fusion
project).
def manifest: () -> untyped
This signature was generated using 1 sample from 1 application.
def manifest @manifest ||= ViteRuby::Manifest.new(self) end
def reload_with(**config_options)
def reload_with(**config_options) @instance = new(**config_options) end
def run(argv, **options)
def run(argv, **options) (@runner ||= ViteRuby::Runner.new(self)).run(argv, **options) end
def run_proxy?
def run_proxy? config.mode == 'development' || (config.mode == 'test' && !ENV['CI']) rescue StandardError => error logger.error("Failed to check mode for Vite: #{ error.message }") false end