Closed nickdima closed 10 years ago
How about an "additionalTransform" option that is a function the user provides? That way we can break the dependency on coffeescript for users who don't use it and can support other compile to js languages. Seem reasonable?
That's a great idea! I'll do that. Thanks Pete!
Added additionalTransform
option to install
function for performing an additional transform on the source file before the react transform.
Here's an example with coffeescript transform:
coffee = require('coffee-script');
require('node-jsx').install({
extension: '.coffee',
additionalTransform: function(src) {
return coffee.compile(src, {
'bare': true
});
}
});
Thanks for this!
Add the abbility to require coffescript files that contain JSX wrapped in backticks by specifying the
.coffee
extension like so:Then simply require your coffeescript module just like a js one, without specifying its extension.