<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/zeit/next.js/issues?q=is%3Aissue">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">require relative path</p>


<h2 dir="auto">Current Behavior</h2>
<p dir="auto">require real path</p>


<h2 dir="auto">Steps to Reproduce (for bugs)</h2>


<ol dir="auto">
<li>import dynamic from 'next/dynamic';</li>
<li>const DynamicToast = dynamic(import('../Toast/Model'))</li>
<li>render </li>
<li>next build</li>
<li>I find this code in the build file</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="require(&quot;/Users/cui/code/bgt-next/.next/dist/&quot;+({0:&quot;chunks/components_Head_CommonDataGet_862fa71fb71bf2f9a1510bd6db4c2d86&quot;,1:&quot;chunks/components_Toast_Model_85c00f4ecc802eef46047a5e1de0328e&quot;}[t]||t)+&quot;-&quot;+{0:&quot;f0f24e5569d7ef5be482&quot;,1:&quot;4889637e50f9c8f8c305&quot;}[t]+&quot;.js&quot;),"><pre class="notranslate"><code class="notranslate">require("/Users/cui/code/bgt-next/.next/dist/"+({0:"chunks/components_Head_CommonDataGet_862fa71fb71bf2f9a1510bd6db4c2d86",1:"chunks/components_Toast_Model_85c00f4ecc802eef46047a5e1de0328e"}[t]||t)+"-"+{0:"f0f24e5569d7ef5be482",1:"4889637e50f9c8f8c305"}[t]+".js"),
</code></pre></div>
<h2 dir="auto">Context</h2>


<h2 dir="auto">Your Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>latest</td>
</tr>
<tr>
<td>node</td>
<td>8.10.1</td>
</tr>
<tr>
<td>OS</td>
<td>mac os 10.13.3</td>
</tr>
<tr>
<td>browser</td>
<td></td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>


<p dir="auto">When I change javascript files inside node_modules folder, the related bundles should get recompiled.</p>
<h2 dir="auto">Current Behavior</h2>


<p dir="auto">I have to restart next server to get the javascript file inside node_modules recompiled.</p>
<h2 dir="auto">Context</h2>


<p dir="auto">I'm sure that webpack watch mode and webpack-dev-middleware have support for recompile bundle whenever any related javascript file changes, but it looks like next disables that and use watcher of itself instead.</p>
<p dir="auto">This behaviour makes debug by tweak code in node_modules very painful.</p>
<h2 dir="auto">Your Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>4.1.3</td>
</tr>
<tr>
<td>node</td>
<td>8.5</td>
</tr>
<tr>
<td>OS</td>
<td>MacOS</td>
</tr>
<tr>
<td>browser</td>
<td>any</td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table>