title: parametrizing browserifiy bundle contents
body: <p>I've got a project built (bundled) with browserify. It supports some functionalities for different locales (different languages). Currently, all locales are loaded using <code>commonJS</code> <code>require</code>s in a row:</p>
  
  <p><code>exports.a = require('./a')
  exports.b = require('./b')
  exports.c = require('./c')
  ...
  </code></p>
  
  <p>but, as you may expect, the bundle get very big and a typical user uses only one locale at a time. The case is to parametrize the bundle somehow. The question is: <strong>how to do it</strong> the best way.</p>
  
  <p>The brute-force I thought of is to provide an input parameter with list of locales, generate a node module which will require only chosen locales and run browserify against it. But it's a nasty brute force, looking for something else.</p>
  
  <p>The are some transforms, such as <em>globify</em>, which allow to bungle chosen filepath wildcards. But I'm not sure whether I can use it in this case.</p>
  
  <p>There is also <a href="https://github.com/substack/browserify-handbook#partitioning" rel="nofollow"><em>partitioning</em></a> in browserify: <em>factor-bundle</em> and <em>partition-bundle</em>. I was analysing partition bundle in this case: to create a map of locales that could be loaded in the browser runtime. But haven't tried it.</p>
  
  <p>I'd appreciate hints on what is a good solution in this case.</p>