title: Make global function in webpack
body: <p>I'm making a typescript plugin with webpack. Everything works well but I have a problem with making it visible from outside. For example, I have files:</p>
  
  <pre><code>/* ./src/a.ts */
  class A {
      constructor(args) {...}
  }
  export default A;
  
  /* ./src/app.ts */
  import A from "./a.ts";
  function init(args) {
     new A(args);
  }
  export { init };
  
  /* ./index.html */
  &lt;html&gt;
  &lt;head&gt;...&lt;/head&gt;
  &lt;body&gt;
  ...
  
  &lt;!-- webpack bundle ts files into ./dist/app.js --&gt;
  &lt;script src="./dist/app.js"&gt;&lt;/script&gt;
  &lt;script&gt;init({...});&lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>With this I got <code>Uncaught ReferenceError: init is not defined</code>. In bundled file I can see that this function is not global, but inside other function like this:</p>
  
  <pre><code>/* 1 */
  /***/ function(module, exports) { ... }
  </code></pre>
  
  <p>How to make this function public?</p>