title: Requiring modules from requirejs (with babeljs plugin) in es6 scripts
body: <p>I'm trying to use <a href="https://github.com/mikach/requirejs-babel" rel="nofollow noreferrer">RequireJS babel plugin</a> along with <a href="https://facebook.github.io/react/" rel="nofollow noreferrer">ReactJS</a> to make a simple class in es6 but cant figure out how to <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import" rel="nofollow noreferrer">Import</a> or Require Reacts library from <a href="http://requirejs.org/" rel="nofollow noreferrer">RequireJS</a> while also exporting the class to use in another script. </p>
  
  <p>Below is the jsbin of what i've done so far but currently it errors when i get to the es6 class because the export is inside the require call but if i remove the require call React.Component wont exist.</p>
  
  <p><a href="https://jsbin.com/dagihecosi/2/edit?html" rel="nofollow noreferrer">HTML</a></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="width=device-width"&gt;
    &lt;script src="https://code.jquery.com/jquery-3.1.0.js"&gt;&lt;/script&gt;
    &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.2/require.min.js"&gt;&lt;/script&gt;
    &lt;script src="https://output.jsbin.com/guvalasowi.js"&gt;&lt;/script&gt;
    &lt;title&gt;JS Bin&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="a-div"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><a href="https://jsbin.com/guvalasowi.js" rel="nofollow noreferrer">RequireJS Config</a></p>
  
  <pre><code>require({
    paths: {
      es6: "https://cdn.rawgit.com/mikach/requirejs-babel/master/es6",
      babel: "https://cdn.rawgit.com/mikach/requirejs-babel/master/babel-5.8.34.min",
      react: "https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react-with-addons.min",
      reactDOM: "https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react-dom.min",
      test: "https://output.jsbin.com/sahudexegu"
    }
  });
  require(['es6!test', 'reactDOM'], function(test, ReactDOM){
    ReactDOM.render(
      table,
      document.getElementById("a-div")
    );
  });
  </code></pre>
  
  <p><a href="https://jsbin.com/sahudexegu.js" rel="nofollow noreferrer">Test Module (es6 class)</a></p>
  
  <pre><code>require(['react'], function(React){
      class Welcome extends React.Component {
        render() {
          return &lt;h1&gt;Hello&lt;/h1&gt;;
        }
      };
  
      export {Welcome};
  });
  </code></pre>
  
  <p>tl;dr: How do you require modules from requirejs when inside es6 scripts and still export a class object?</p>