title: How do I use SystemJS Builder buildStatic?
body: <p>I am trying to do a simple example using SystemJS Builder by building a SFX bundle, but I cannot get it to work. I cannot figure out how to call exported functions that were in the bundle. Am I missing something obvious?</p>
  
  <p>index.html</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script src="app.bundle.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          all();
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>gulpfile.js</p>
  
  <pre><code>var path = require('path');
  var gulp = require('gulp');
  var Builder = require('systemjs-builder');
  
  gulp.task('default', function(cb) {
      var builder = new Builder('.', './jspm.config.js');
      builder.buildStatic('src/app.js', 'dist/app.bundle.js').then(cb());
  });
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>import { hello } from 'src/app/hello';
  
  export function all() {
      hello();
  }
  </code></pre>
  
  <p>hello.js</p>
  
  <pre><code>export function hello() {
      console.log("hello");
  };
  </code></pre>
  
  <p>When I try to load index.html, it loads the app.bundle.js file correctly, but I can't seem to figure out how to call all() and I get <code>Uncaught ReferenceError: all is not defined</code> in Chrome.</p>
  
  <p>The bundle file looks reasonable, I think:</p>
  
  <pre><code>// ... Some minified SystemJS content...
  
  (["1"], [], function($__System) {
  
  $__System.register("2", [], function (_export) {
      "use strict";
  
      _export("hello", hello);
  
      function hello() {
          console.log("hello");
      }
  
      return {
          setters: [],
          execute: function () {
              ;
          }
      };
  });
  
  $__System.register('1', ['2'], function (_export) {
      'use strict';
  
      var hello;
  
      _export('all', all);
  
      function all() {
          hello();
      }
  
      return {
          setters: [function (_) {
              hello = _.hello;
          }],
          execute: function () {}
      };
  });
  
  })
  (function(factory) {
  
    if (typeof define == 'function' &amp;&amp; define.amd)
      define([], factory);
    else if (typeof module == 'object' &amp;&amp; module.exports &amp;&amp; typeof require == 'function')
      module.exports = factory();
    else
      factory();
  });
  </code></pre>