class React::Rails::AssetVariant

This class accepts some options for which build you want, then exposes where you can find them. In general, these paths should be added to the sprockets environment.

Constants

GEM_ROOT

Attributes

jsx_directory[R]

@return [String] The path which contains the JSX Transformer

react_build[R]

@return [String] “production” or “development”

react_directory[R]

@return [String] The path which contains the specified React.js build as “react.js”

Public Class Methods

new(options={}) click to toggle source

@param [Hash] Options for the asset variant @option variant [Symbol] if ‘:production`, use the minified React.js build

# File lib/react/rails/asset_variant.rb, line 18
def initialize(options={})

  @react_build = options[:variant] == :production ? 'production' : 'development'

  @react_directory = GEM_ROOT.join('lib/assets/react-source/').join(@react_build).to_s
  @jsx_directory =   GEM_ROOT.join('lib/assets/javascripts/').to_s
end