title: how to use webpack dll plugin in server-side rendering
body: <p>I am trying to use webpack's dllPlugin to get my chunk small, and I made it work well in client-side but something wrong in server-side rendering.</p>
  
  <p>I used <a href="https://github.com/webpack/webpack/tree/master/examples/dll" rel="noreferrer">this</a> as an example, and make it simpler, here is my demo code:</p>
  
  <p>webpack.config.dll.js</p>
  
  <pre><code>// webpack.config.dll.js
  const path = require('path');
  const webpack = require('webpack');
  
  module.exports = {
    entry: {
      a: ['./a']
    },
    output: {
      path: path.join(__dirname, 'dist'),
      filename: '[name].js',
      library: '[name]'
    },
    plugins: [
      new webpack.DllPlugin({
        path: path.join(__dirname, 'dist', 'manifest.json'),
        name: '[name]'
      })
    ]
  }
  </code></pre>
  
  <p>webpack.config.js</p>
  
  <pre><code>// webpack.config.js
  const path = require('path');
  const webpack = require('webpack');
  
  module.exports = {
    entry: './example',
    output: {
      path: path.join(__dirname, 'dist'),
      filename: 'output.js'
    },
    plugins: [
      new webpack.DllReferencePlugin({
        context: __dirname,
        manifest: require('./dist/manifest.json')
      })
    ]
  };
  </code></pre>
  
  <p>other js code and html code is</p>
  
  <pre><code>// a.js
  module.exports = 'a';
  
  // example.js
  console.log(require("./a"));
  
  // index.html
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;script src="dist/a.js"&gt;&lt;/script&gt;
    &lt;script src="dist/output.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>if I open the index.html in browser, it work well and output 'a' in console. But if I excute <code>node dist/output.js</code>, it will get error:</p>
  
  <pre><code>/WorkSpace/code/webpack/005_dllPluginDemo_20160813/dist/output.js:64
      module.exports = a;
                       ^
  
  ReferenceError: a is not defined
      at Object.&lt;anonymous&gt; (/WorkSpace/code/webpack/005_dllPluginDemo_20160813/dist/output.js:64:19)
      at __webpack_require__ (/WorkSpace/code/webpack/005_dllPluginDemo_20160813/dist/output.js:20:30)
      at Object.module.exports (/WorkSpace/code/webpack/005_dllPluginDemo_20160813/dist/output.js:58:20)
      at __webpack_require__ (/WorkSpace/code/webpack/005_dllPluginDemo_20160813/dist/output.js:20:30)
      at Object.&lt;anonymous&gt; (/WorkSpace/code/webpack/005_dllPluginDemo_20160813/dist/output.js:48:14)
      at __webpack_require__ (/WorkSpace/code/webpack/005_dllPluginDemo_20160813/dist/output.js:20:30)
      at /WorkSpace/code/webpack/005_dllPluginDemo_20160813/dist/output.js:40:18
      at Object.&lt;anonymous&gt; (/WorkSpace/code/webpack/005_dllPluginDemo_20160813/dist/output.js:43:10)
      at Module._compile (module.js:413:34)
      at Object.Module._extensions..js (module.js:422:10)
  </code></pre>
  
  <p>so it means that I can't require output.js in my code. Unfortunately, I need do that when I try to render in server, just like <a href="https://github.com/reactGo/reactGo/blob/master/server/index.js#L8" rel="noreferrer">this boilerplates</a></p>
  
  <p>and I think the problem is that the module a had been deal twice by webpack</p>
  
  <p>So is there anybody met this problem? And how did you solve it, wish your answer, thanks</p>