Sha256: d115013d5173820bf8bc7d2bb190e6d5fc48f2c0fff879a0083876b30828ba1a
Contents?: true
Size: 589 Bytes
Versions: 5
Compression:
Stored size: 589 Bytes
Contents
# frozen_string_literal: true module React module ServerRendering # Return asset contents by getting them from a Sprockets::Environment instance. # # This is good for Rails development but bad for production because: # - It compiles the asset lazily, not ahead-of-time # - Rails 5 / Sprockets 3 doesn't expose a Sprockets::Environment in production. class EnvironmentContainer def initialize @environment = ::Rails.application.assets end def find_asset(logical_path) @environment[logical_path].to_s end end end end
Version data entries
5 entries across 5 versions & 1 rubygems