title: How do I include npm modules in webpack DLLs?
body: <p>I'm trying to use the DLL plugins of webpack (version 1.13) to create a DLL bundle that contains all the npm modules I need for my various React projects (i.e. preact, preact-compat, redux, react-redux, redux-saga, recompose). I want to distribute the DLL bundle that contains all these npm modules via my shop's internal npm repo. Several web applications should load the DLL bundle from the npm repo and use the modules included therein.</p>
  
  <p>In the example for <a href="https://github.com/webpack/webpack/tree/master/examples/dll" rel="noreferrer">using DLLs in webpack from the webpack repo on GitHub</a>, a module named <code>module</code> is included in the alpha-DLL. <code>module</code> comes from the <code>node_modules</code> directory in the examples dir (one dir below the dll dir).</p>
  
  <p>This works, when I build the example in the dll-user dir using node build.js and look at <code>dll-user/js/output.js</code>, I can see these lines:</p>
  
  <p><code>
  /*!*****************************************************************************************!*\
    !*** delegated ../node_modules/module.js from dll-reference alpha_e0d5512587ca63cbbd71 ***!
    \*****************************************************************************************/
  </code></p>
  
  <p>The module named <code>module</code> is, however not really a proper npm module, it is just a file named <code>module.js</code> sitting directly in the <code>node_module</code> directory. I tried including a “real world” npm module, in this case <code>preact</code>.</p>
  
  <p>After building the <code>dll</code> and <code>dll-user</code> projects, looking at the <code>output.js</code> file, I can see that the whole code of the preact module was included in the output, there is no delegation happening.</p>
  
  <p><strong>How do I make this work properly? Is it a bug in webpack?</strong></p>
  
  <p>I've created a code example on GitHub based on the webpack DLL example that shows the problem: <a href="https://github.com/pahund/webpack-dll-problem" rel="noreferrer">https://github.com/pahund/webpack-dll-problem</a></p>