title: How to get started with Webpack
body: <p>I'm having trouble understanding the workflow of webpack.  </p>
  
  <p>In a regular project, I would have something like this:  </p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;button onclick = "doSomething()"&gt;&lt;/button&gt;  
  </code></pre>
  
  <p>And then in javascript I'll write the function</p>
  
  <pre><code>function doSomething(){}  
  </code></pre>
  
  <p>I understand as the project grows I need to make the javascript more modular using Webpack. But how do I make the bundled javascript interact with the HTML? For example:  </p>
  
  <p>entry.js (pseudo code):</p>
  
  <pre><code>import moduleThatDoesThings;  
  </code></pre>
  
  <p>moduleThatDoesThings.js:  </p>
  
  <pre><code>function doSomething(){}  
  </code></pre>
  
  <p>This won't work:  </p>
  
  <p>HTML:  </p>
  
  <pre><code>&lt;button onclick="moduleThatDoesThings.doSomething()"&gt;&lt;/button&gt;
  </code></pre>
  
  <p>How do I call functions from modules in the HTML? Or am I supposed to think like this at all? If not how should I structure the project?</p>