selecting webpack dll bundle via scope mode
<p>In the webpack examples, in particular</p>

<ul>
<li><a href="https://github.com/webpack/webpack/tree/master/examples/dll" rel="nofollow noreferrer">https://github.com/webpack/webpack/tree/master/examples/dll</a></li>
<li><a href="https://github.com/webpack/webpack/tree/master/examples/dll-user" rel="nofollow noreferrer">https://github.com/webpack/webpack/tree/master/examples/dll-user</a></li>
</ul>

<p>We can create a bundle that depends on already pre-bundled libraries.
The examples at hand work as they should. That is, we first navigate
to <code>examples/dll</code> and run <code>node build.js</code> to create the libraries. Then we navigate to <code>examples/dll-user</code> and run <code>node build.js</code> to create our final bundles that reference the previously bundled libraries.</p>

<p>My question is the following. Suppose that in <code>examples/dll</code> we modify the configuration file to look as follows:</p>

<pre><code>var path = require("path");
var webpack = require("../../");
module.exports = {
    entry: {
        alpha: ["./alpha", "./a", "module"],
        beta: ["./beta", "./b", "module"]
    },
    output: {
        path: path.join(__dirname, "js"),
        filename: "MyDll.[name].js",
        library: "[name]_[hash]"
    },
    plugins: [
        new webpack.DllPlugin({
            path: path.join(__dirname, "js", "[name]-manifest.json"),
            name: "[name]_[hash]"
        })
    ]
};
</code></pre>

<p>That is, we added <code>module</code> to the <code>beta</code> dll. Now we have to dlls that have <code>module</code>. Lets compile the dlls and move on to <code>dll-user</code> example. Here what we would like to do is make a bundle from which we can choose the library that will provide <code>module</code>. Lets try adding one more line to the example</p>

<pre><code>console.log(require("../dll/alpha"));
console.log(require("../dll/a"));

console.log(require("beta/beta"));
console.log(require("beta/b"));

console.log(require("module"));
console.log(require("beta/module"));
</code></pre>

<p>In this case I want to be able to use the <code>module</code> that resides in the <code>beta</code> dll. Unfortunately I was not lucky. This is the output I obtain after trying it:</p>

<pre><code>jmlopez in ~/Downloads/webpack-master/examples/dll-user$ node build.js 
{ [Error: Command failed: /bin/sh -c node ../../bin/webpack.js --display-reasons --display-chunks --display-modules --display-origins --output-public-path "js/" -p  ./example.js js/output.js
]
  killed: false,
  code: 2,
  signal: null,
  cmd: '/bin/sh -c node ../../bin/webpack.js --display-reasons --display-chunks --display-modules --display-origins --output-public-path "js/" -p  ./example.js js/output.js' }
Hash: bd42dda7e56ebfd7cd32
Version: webpack 2.1.0-beta.6
Time: 68ms
    Asset     Size  Chunks             Chunk Names
output.js  4.26 kB       0  [emitted]  main
chunk    {0} output.js (main) 504 bytes [rendered]
    &gt; main [7] ./example.js 
    [7] ./example.js 210 bytes {0} [built] [1 error]
     + 7 hidden modules

ERROR in ./example.js
Module not found: Error: Can't resolve 'beta/module' in '/Users/jmlopez/Downloads/webpack-master/examples/dll-user'
 @ ./example.js 8:12-34

{ [Error: Command failed: /bin/sh -c node ../../bin/webpack.js --display-reasons --display-chunks --display-modules --display-origins --output-public-path "js/" --output-pathinfo  ./example.js js/output.js
]
  killed: false,
  code: 2,
  signal: null,
  cmd: '/bin/sh -c node ../../bin/webpack.js --display-reasons --display-chunks --display-modules --display-origins --output-public-path "js/" --output-pathinfo  ./example.js js/output.js' }
</code></pre>

<p>Is there any way to specify the library that the bundle should use? I thought the <code>scope</code> option in <code>DllReferencePlugin</code> would do the trick but it doesn't seem to be the case.</p>

<p><strong>EDIT:</strong> Note that adding <code>./a</code> to the beta dll and then using <code>require('beta/a')</code> in the example works. It seems that webpack has a hard time figuring it out the node_modules.</p>