We are running a setup where React components that are written in CommonJS/ES5 on the backend need to be available on the front-end also for React rendering on both server and client.
I am trying to figure out how to transpile the React components from JSX to JS as well as from CommonJS to AMD.
Now, it's quite possible that there is no real way to "transpile" from CommonJS to AMD. So we could write it in ES6. If we write the React component code in ES6, how can we transpile that to AMD? I am having trouble finding a gulp plugin that does this.
I tried this:
http://www.sitepoint.com/transpiling-es6-modules-to-amd-commonjs-using-babel-gulp/
but I believe the babel({modules:'AMD'}) style is old, I don't think Babel knows what the modules property is anymore.