title: Cannot Export JS Module
body: <p>I've got a module called utilities in a <code>utilities.js</code> file. I am using it for some basic js functions and I want to hide the module from the global namespace. I understand that to do this I should create a module, export it, import it in the needed file, then invoke its functions. However, I cannot seem to properly export the module. I figure this is pretty simple but everything I have tried gives an error. Here is my code:</p>
  
  <pre><code>var utilities = (function(){
  return {
      debounce: function(func, wait, immediate){
          var timeout;
          return function() {
              var context = this, args = arguments;
              var later = function() {
                  timeout = null;
                  if (!immediate) func.apply(context, args);
              };
              var callNow = immediate &amp;&amp; !timeout;
              clearTimeout(timeout);
              timeout = setTimeout(later, wait);
              if (callNow) func.apply(context, args);
          };
      }
  }
  })();
  
  export { utilities };
  </code></pre>
  
  <p>My error:</p>
  
  <pre><code>application.js:12560 Uncaught SyntaxError: Unexpected token export
  </code></pre>