Inspired (and pretty much a clone of really) the react-rails gem for Middleman. This gem allows you to write and use *.jsx assets inside Middleman.
gem install middleman-reactactivate :reactinconfig.rb
It is also possible to pass options through to the JSX compiler if that’s your thing:
activate :react do |config|
config.harmony = true
config.strip_types = true
endIn your Middleman config.rb add the following:
after_configuration do
sprockets.append_path File.dirname(::React::Source.bundled_path_for('react.js'))
endNow you can Sprockets include React:
//= require react
Or with addons:
//= require react-with-addons
The version for this gem will reflect that of the underlying version of react-source, meaning that using 0.12.1 of this gem will give you version 0.12.1 of React. This is the same approach that react-rails takes.
If updates to the gem code are required that do not alter the react-source version in use need to be made they will be released with a .x version appended, eg: 0.12.1.x.
- Fork it!
- Get set up:
./script/bootstrap - ...?
- Run specs:
./script/spec - Pull request!

