Transpiling CommonJS/ES6 modules to AMD
<p>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.</p>

<p>I am trying to figure out how to transpile the React components from JSX to JS as well as from CommonJS to AMD.</p>

<p>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.</p>

<p>I tried this:</p>

<p><a href="http://www.sitepoint.com/transpiling-es6-modules-to-amd-commonjs-using-babel-gulp/" rel="nofollow">http://www.sitepoint.com/transpiling-es6-modules-to-amd-commonjs-using-babel-gulp/</a></p>

<p>but I believe the <code>babel({modules:'AMD'})</code> style is old, I don't think Babel knows what the modules property is anymore.</p>