Hi, I am migrating from Express/Node Brunch React Setup. I got interested in Meteor because of it’s support for ReactMeteor.
I am trying to get going with CoffeeScript, and I want CJSX support (please):
perhaps: https://www.npmjs.com/package/node-cjsx
I’m trying to get this all rolling, but I’m trying to create a plugin, the documentation is a little terse - and a little too white paper like regarding: https://github.com/meteor/meteor/wiki/CompileStep-API-for-Build-Plugin-Source-Handlers
I guess I am still looking for some more examples that also show file trees and step by step to create this type of plugin. I’m scratching my head, because I want to know:
-
How do I add this plugin
-
Do I have to add this to a config?
-
How do I debug and console output when these plugins run??
function handler(compileStep) {
var source = compileStep.read().toString(‘utf8’);
var outputFile = compileStep.inputPath + “.js”;compileStep.addJavaScript({
path: outputFile,
sourcePath: compileStep.inputPath,
data: reactTools.transform(source, {
harmony: true
})
});
}
Plugin.registerSourceHandler(“jsx”, handler);
Also, I am used to using require in code for coffeescript modules, I like to separate my components (I don’t like messy globals everywhere btw) best way to take this practice I am use to and migrate my thinking or bending react into being my b*tch, I am looking for those suggestions too.
I like the meteor add command, but the support is a little too limited and it does a little voodoo I am not use to when working with npm.
Thanks for your answers
Looking forward to coding on my app and giving it a shot.