<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"><code class="notranslate">next build</code> does not include absolute path to node module</p>
<h2 dir="auto">Current Behavior</h2>


<p dir="auto"><code class="notranslate">next build</code> includes absolute path in transpiled require path</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<h3 dir="auto">Correct</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="yarn add next@4.2.0
next build

# Transpiled output
var _extends2 = require('babel-runtime/helpers/extends');"><pre class="notranslate">yarn add next@4.2.0
next build

<span class="pl-c"><span class="pl-c">#</span> Transpiled output</span>
var _extends2 = require(<span class="pl-s"><span class="pl-pds">'</span>babel-runtime/helpers/extends<span class="pl-pds">'</span></span>)<span class="pl-k">;</span></pre></div>
<h3 dir="auto">Incorrect</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="yarn add next@canary
next build

# Transpiled output
var _extends2 = require('/Users/kyle/projects/test/node_modules/babel-runtime/helpers/extends');"><pre class="notranslate">yarn add next@canary
next build

<span class="pl-c"><span class="pl-c">#</span> Transpiled output</span>
var _extends2 = require(<span class="pl-s"><span class="pl-pds">'</span>/Users/kyle/projects/test/node_modules/babel-runtime/helpers/extends<span class="pl-pds">'</span></span>)<span class="pl-k">;</span></pre></div>
<h2 dir="auto">Context</h2>


<p dir="auto">Unable to deploy to lambda using <a href="https://github.com/apex/up">up</a> due to <code class="notranslate">up</code> building locally and uploading zip file to s3 rendering absolute paths invalid</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>canary</td>
</tr>
<tr>
<td>node</td>
<td>8.9.0</td>
</tr>
<tr>
<td>OS</td>
<td>macos 10.13.2</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">Users should be able to bundle different modules into one final chunk.</p>
<p dir="auto">For example, users importing component <code class="notranslate">hello1.js</code> and <code class="notranslate">hello2.js</code> may want to import both modules at the same time:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const Hello1 = dynamic(import('../components/hello1'))
const Hello2 = dynamic(import('../components/hello2'))
// This will request both hello1.js and hello2.js."><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-v">Hello1</span> <span class="pl-c1">=</span> <span class="pl-en">dynamic</span><span class="pl-kos">(</span><span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-s">'../components/hello1'</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-k">const</span> <span class="pl-v">Hello2</span> <span class="pl-c1">=</span> <span class="pl-en">dynamic</span><span class="pl-kos">(</span><span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-s">'../components/hello2'</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-c">// This will request both hello1.js and hello2.js.</span></pre></div>
<h2 dir="auto">Current Behavior</h2>


<p dir="auto">Webpack 3 allows you to do so using magic comments:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const Hello1 = dynamic(/* webpackChunkName: &quot;hello&quot; */ import('../components/hello1'))
const Hello2 = dynamic(/* webpackChunkName: &quot;hello&quot; */ import('../components/hello2'))
// This should request only one hello.js with both modules."><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-v">Hello1</span> <span class="pl-c1">=</span> <span class="pl-en">dynamic</span><span class="pl-kos">(</span><span class="pl-c">/* webpackChunkName: "hello" */</span> <span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-s">'../components/hello1'</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-k">const</span> <span class="pl-v">Hello2</span> <span class="pl-c1">=</span> <span class="pl-en">dynamic</span><span class="pl-kos">(</span><span class="pl-c">/* webpackChunkName: "hello" */</span> <span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-s">'../components/hello2'</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-c">// This should request only one hello.js with both modules.</span></pre></div>
<p dir="auto">But magic comments don't work on <strong>nextjs</strong>.</p>
<h2 dir="auto">Context</h2>


<p dir="auto">Sometimes a user requesting a module is going to need more modules in the future and you can bundle those in a single chunk to avoid server round trips.</p>
<h2 dir="auto">Your Environment</h2>

<ul dir="auto">
<li>Next.js version: 3.0.1-beta.5</li>
<li>Environment name and version (e.g. Chrome 39, Node.js 5.4): Chrome 61, Node 6.11</li>
<li>Operating System (Linux, maxOS, Windows): macOS</li>
</ul>