title: Using require in html JS file and it worked! Why?
body: <p>I have installed a node package:</p>
  
  <pre><code>$ npm truffle-contract
  </code></pre>
  
  <p>It has a file truffle-contract/dist/truffle-contract.js file which can be used in HTML.  When I look at the file, I can see that it is using REQUIRE to load other packages from the npm.  </p>
  
  <pre><code>var ethJSABI = require("ethjs-abi");
  </code></pre>
  
  <p>I thought other files had to be used by using an include as require is node.js specific?</p>
  
  <p>It has this at the top:</p>
  
  <pre><code>(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&amp;&amp;require;if(!u&amp;&amp;a)r....
  </code></pre>
  
  <p>Can anyone explain how it is working/done?</p>
  
  <p>Even if it is somehow loading the other packages, I don't understand how it is doing that given I installed the packages local rather than global and apache is running as a different use.</p>
  
  <p>Full file here:
  <a href="https://gist.github.com/ianmonkuk/d969f52019ec602ca2a6d55231a27919" rel="nofollow noreferrer">https://gist.github.com/ianmonkuk/d969f52019ec602ca2a6d55231a27919</a></p>
  
  <p>Thanks, Ian</p>