Using Middleman, how can I chain multiple file extensions for processing by multiple engines?
Middleman handles CoffeeScript out of the box, and I have gem middleman-react
in my Gemfile
and activate :react
in my config.rb
.
Processing regular jsx files like my_file.js.jsx
works fine, but I want to have a file like my_file.js.jsx.coffee
, which isn't working.
It's parsed correctly as CoffeeScript, but is then not parsed as jsx
.
Here's some sample output:
BoardRow = React.createClass({
render: function() {
return <tr className='row'>{this.props.intersections}</tr>;
}
});
Based on this post it looks like this kind of thing should be possible.
It turns out that the magic jsx comment was malformed in my CoffeeScript file, so the parser was skipping it.
Make sure your CoffeeScript file starts with:
###* @jsx React.DOM ###