title: Rails 5: How to include JS global functions with webpacker?
body: <p>Let's say I have to load a js function with turbolinks:</p>
  <pre><code>document.addEventListener(&quot;turbolinks:load&quot;, function() {
      myFunction();
    }
  );
  </code></pre>
  <p>But the function is very large and I wanted to avoid to added it to <em>application.js</em>. Thus I succeded to import it with <strong>exports-loader</strong>, for example:</p>
  <pre><code>import { myFunction } from 'exports-loader?exports=myFunction!./file.js';
  </code></pre>
  <p>But how to import a global function like <strong>window.myFunction</strong> ?</p>