title: ReactJS.net - How do I use ES6 modules
body: <p>I have ReactJS.Net successfully running, including using ES6 syntax.</p>
  
  <p>I am using the default Jsx transformation pipeline, which is using Babel.
  Looking at source in the browser I can see that ES6 code has been converted to ES5 by ReactJS.Net</p>
  
  <p>I have been unable to get modules working.</p>
  
  <p>The browser gives me 2 errors:</p>
  
  <pre><code>Uncaught ReferenceError: exports is not defined
  Uncaught ReferenceError: require is not defined
  </code></pre>
  
  <p>How do I use ES6 Modules?</p>
  
  <p>Simplest example:</p>
  
  <p>Lib.js</p>
  
  <pre><code>export function square(x) {
      return x * x;
  }
  </code></pre>
  
  <p>UserOfLib.js</p>
  
  <pre><code>import { square } from 'Lib';
  console.log(square(11)); 
  </code></pre>
  
  <p>Gets transformed to this (looking at browser source):</p>
  
  <p>Lib:</p>
  
  <pre><code>// @hash v3-AD133907ABEC5D32B3768A3AF2301FC9
  // Automatically generated by ReactJS.NET. Do not edit, your changes will be overridden.
  // Version: 2.0.1 (build 5e9476a)
  // Generated at: 08-Nov-15 6:40:26 AM
  ///////////////////////////////////////////////////////////////////////////////
  Object.defineProperty(exports, "__esModule", {
      value: true
  });
  exports.square = square;
  
  function square(x) {
      return x * x;
  }
  </code></pre>
  
  <p>UserOfLib:</p>
  
  <pre><code>// @hash v3-812C209AFED25C2B4507E5769B0D899B
  // Automatically generated by ReactJS.NET. Do not edit, your changes will be overridden.
  // Version: 2.0.1 (build 5e9476a)
  // Generated at: 08-Nov-15 6:40:26 AM
  ///////////////////////////////////////////////////////////////////////////////
  var _Lib = require('Lib');
  
  console.log((0, _Lib.square)(11)); // 121
  </code></pre>