cjsx-coffee-brunch
v0.0.3
Published
Adds CJSX support to brunch and compile the resulting CoffeeScript.
Downloads
5
Readme
Coffeescript JSX compile for brunch
cjsx-coffee-brunch
Adds React support to brunch
by automatically compiling *.cjsx
files to JavaScript.
Optional
You can configure react-brunch to automatically insert a react header
(# @cjsx React.DOM
) into all *.cjsx
files. Disabled by default.
Example config.coffee
:
exports.config =
plugins:
react:
autoIncludeCommentBlock: yes
modules:
nameCleaner: (path) ->
path
# Strip the .cjsx extension from module names
.replace(/\.cjsx/, '')
# Usual brunch config stuf...
files:
javascripts:
joinTo: 'app.js'
stylesheets:
joinTo: 'app.css'
templates:
joinTo: 'app.js'
Usage
Install the plugin via npm with npm install --save coffee-react-brunch
.
Or, do manual install:
- Add
"coffee-react-brunch": "x.y.z"
topackage.json
of your brunch app. Pick a plugin version that corresponds to your minor (y) brunch version. - If you want to use git version of plugin, add
"coffee-react-brunch": "git+ssh://[email protected]:brunch/coffee-react-brunch.git"
.
Credit
This is based on Paul Miller's javascript-brunch project and Matt McCray's react-brunch and adjusted to compile React (.cjsx) files.