title: Javascript 6to5 (now Babel) export module usage
body: <p>I'm still a beginner, i try to to export and import one class into a main file, the other class in the others class file and use them. </p>
  
  <p>And then gulp ES5 code with 6to5 (now Babel).</p>
  
  <pre><code>// file a.js
  import B from 'b.js';
  
  class A {
    constructor() {
      B.methodB();
    }
  }
  
  export default A;
  
  // file b.js
  class B {
    methodB() {
      console.log('hi from b');
    }
  }
  
  export default B;
  
  // file main.js
  import A from 'a.js';
  new A();
  </code></pre>
  
  <p>My gulpfile:</p>
  
  <pre><code>var gulp = require('gulp');
  var to5 = require('gulp-6to5');
  
  gulp.task('default', function () {
    return gulp.src('main.js')
      .pipe(to5())
      .pipe(gulp.dest('dist'));
   });
  </code></pre>
  
  <p>And this is my <code>dist/main.js</code> file:</p>
  
  <pre><code>"use strict";
  
  var _interopRequire = function (obj) {
    return obj &amp;&amp; (obj["default"] || obj);
  };
  
  var A = _interopRequire(require("a.js"));
  
  new A();
  </code></pre>
  
  <p>The error in console: <code>ReferenceError: require is not defined</code> </p>
  
  <p>Which of course does not work ... what am I doing wrong or what lack I yet? I do not get it exactly.</p>