title: webpack require with variable
body: <p>I searched the docs but couldn't find clear answer to this.<br/>  For example, somewhere in the code I have <em>require(foo)</em>, where foo is a variable and so its value is not known at compile time.  But say I do know that in my application the value of foo can only be &quot;bar1&quot; or &quot;bar2&quot;.  If I build the bundle as is, the modules &quot;bar1&quot; and &quot;bar2&quot; will not be included because they are not explicitly referenced.  Is it possible to specify in webpack config to include these modules into the bundle (even though they are not referenced), so that at runtime the statement <em>require(foo)</em> will work, as long as the value of foo is &quot;bar1&quot; or &quot;bar2&quot;?<br/>
  I understand that there is a simple workaround, by including somewhere in the code something like:</p>
  <pre><code>    const bar1 = require(&quot;bar1&quot;);
      const bar2 = require(&quot;bar2&quot;);
  </code></pre>
  <p>but was wondering if there is a way to do this via webpack config. Is there way to explicitly include modules into the bundle, knowing that they may/will be used at runtime?</p>