title: Browserify: using external libraries from within bundle
body: <p>Our team develops browser side <code>javascript</code> app. We use <code>angularjs</code> as framework and some helper libraries in global namespace. For example: <code>underscore</code>.</p>
  
  <p>We carried out a large piece of code (input/output data tranformation) into a standalone library for unit testing reasons.</p>
  
  <p>Now i try to use <code>browserify</code> with this library. The question is about what the best way to exclude from bundle shared (with main app) dependences (underscore for example).
  I tried 2:</p>
  
  <ol>
  <li>Using --external. I have to create bundle from underscore and use it for all code stuff in app. If i understood right this way seems inconvenient.</li>
  <li><p>Using <code>browser</code> property in package.json to replace underscore with stub:</p>
  
  <p>module.exports = _;</p></li>
  </ol>
  
  <p>I believe that there is more clean approach, but where is it?</p>