<h1 dir="auto">Bug report</h1>




<p dir="auto"><strong>What is the current behavior?</strong><br>
I'm using code splitting (via SplitChunksPlugin) to extract common dependencies. I have multiple entry points. The output target is node.<br>
When trying to run the successfully bundled code, I get the error <code class="notranslate">TypeError: Cannot read property 'call' of undefined</code>.<br>
When I remove code splitting from my config, the output runs without error.</p>
<p dir="auto">Some commonalities with previous comments:</p>
<ul dir="auto">
<li>I have multiple named entry points and one depends on the other, as in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="67209917" data-permission-text="Title is private" data-url="https://github.com/webpack/webpack/issues/959" data-hovercard-type="issue" data-hovercard-url="/webpack/webpack/issues/959/hovercard?comment_id=397449112&amp;comment_type=issue_comment" href="https://github.com/webpack/webpack/issues/959#issuecomment-397449112">#959 (comment)</a></li>
<li>One of my files imports the relative path <code class="notranslate">'../../fixtures/mock_users.json'</code>, similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="67209917" data-permission-text="Title is private" data-url="https://github.com/webpack/webpack/issues/959" data-hovercard-type="issue" data-hovercard-url="/webpack/webpack/issues/959/hovercard?comment_id=118394128&amp;comment_type=issue_comment" href="https://github.com/webpack/webpack/issues/959#issuecomment-118394128">#959 (comment)</a>.</li>
</ul>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong><br>
I've provided a minimal project setup that reproduces the problem: <a href="https://gitlab.com/jlapointe/codesplittingtest" rel="nofollow">https://gitlab.com/jlapointe/codesplittingtest</a></p>






<p dir="auto"><strong>What is the expected behavior?</strong><br>
The code generated using code splitting should behave identically to the code generated without using code splitting.</p>


<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  4.31.0<br>
Node.js version: 10.15.3<br>
Operating System: Ubuntu 18.04 LTS<br>
Additional tools: NodeExternals</p>
<p dir="auto">If you add aliases into your DllPlugin, it will only write out the raw file path. This causes issues when you have to dual maint. aliases. Also when you are trying to abstract out logic, such as locale-specific bundles.</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sokra/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sokra">@sokra</a> Is there a likelihood that this feature is possible and would be accepted if I put in a PR?</p>
<p dir="auto">Example:</p>
<p dir="auto"><strong>DllPlugin</strong></p>
<p dir="auto"><em>vendor.js</em></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="require('underscore');"><pre class="notranslate"><code class="notranslate">require('underscore');
</code></pre></div>
<p dir="auto"><em>vendor.config.js</em></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
    entry: {
        locale: [path.resolve('./vendor.js')]
    },
    output: {
        path: path.resolve('./build/'),
        filename: '[name].bundle.js',
        library: '[name]'
    },
    plugins: [
        new webpack.DllPlugin({
            name: '[name]',
            path: 'build/vendor-manifest.json'
        })
    ],
    resolve: {
        extensions: ['', '.js'],
        alias: {
            'underscore': path.join('bower_components', 'lodash', 'dist', 'lodash.js')
        }
    }
}"><pre class="notranslate"><code class="notranslate">{
    entry: {
        locale: [path.resolve('./vendor.js')]
    },
    output: {
        path: path.resolve('./build/'),
        filename: '[name].bundle.js',
        library: '[name]'
    },
    plugins: [
        new webpack.DllPlugin({
            name: '[name]',
            path: 'build/vendor-manifest.json'
        })
    ],
    resolve: {
        extensions: ['', '.js'],
        alias: {
            'underscore': path.join('bower_components', 'lodash', 'dist', 'lodash.js')
        }
    }
}
</code></pre></div>
<p dir="auto"><em>vendor-manifest.json</em></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;name&quot;: &quot;vendor&quot;,
  &quot;content&quot;: {
    &quot;./bower_components/lodash/lodash.js&quot;: 1,
    &quot;./vendor.js&quot;: 2
  }
}"><pre class="notranslate"><code class="notranslate">{
  "name": "vendor",
  "content": {
    "./bower_components/lodash/lodash.js": 1,
    "./vendor.js": 2
  }
}
</code></pre></div>