<h1 dir="auto">Feature request</h1>
<h2 dir="auto">Is your feature request related to a problem? Please describe.</h2>
<p dir="auto">Currently when deploying to now 2.0 we force all dependencies to be <code class="notranslate">devDependencies</code>, the reason for this is creating the <em>smallest possible lambda</em>.<br>
This however introduces some issues:</p>
<ul dir="auto">
<li>When everything is a devDependency, how are my pages requiring these modules?
<ul dir="auto">
<li>answer: <code class="notranslate">next build --lambdas</code> bundles imported modules and no longer uses <code class="notranslate">externals</code> for this reason.</li>
</ul>
</li>
<li>When the user has a <code class="notranslate">next.config.js</code> that uses any module, most commonly a Next.js plugin like <code class="notranslate">@zeit/next-css</code> loading <code class="notranslate">next.config.js</code> in production will fail because of the module not being there. However this opens up the question: why is <a class="issue-link js-issue-link notranslate" rel="noopener noreferrer nofollow" href="https://linear.app/vercel/issue/NEXT-css">next-css</a> being loaded on cold start in production.</li>
</ul>
<h2 dir="auto">Describe the solution you'd like</h2>
<p dir="auto">One solution is forcing <code class="notranslate">phases</code> to be used, documentation can be found here: <a href="https://github.com/zeit/next.js#custom-configuration">https://github.com/zeit/next.js#custom-configuration</a></p>
<p dir="auto">However there are alternatives, for example:</p>
<ul dir="auto">
<li>bundling the configuration (would also allow for <code class="notranslate">next.config.ts</code> or similar. At first glance this seems like a solution, however it doesn't solve the build-time modules being loaded in production mode.</li>
<li>No longer allowing a "runtime" next.config.js, this would be a breaking change but it would make a lot of sense since this forces applications to optimize at build and not have runtime values being passed for convenience. However we'd still need a way to allow <code class="notranslate">publicRuntimeConfig</code> and <code class="notranslate">assetPrefix</code> (which does work at runtime), which is for example used by Trulia's appshell.</li>
</ul>
<h2 dir="auto">Describe alternatives you've considered</h2>
<p dir="auto">I'd love to know how people are using <code class="notranslate">next.config.js</code> currently. From what I've seen the vast majority looks like the equivalent of:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const thePlugin = require('theplugin')
module.exports = thePlugin({})"><pre class="notranslate"><code class="notranslate">const thePlugin = require('theplugin')
module.exports = thePlugin({})
</code></pre></div>
<h2 dir="auto">Additional context</h2>
<p dir="auto">Issue reference for Now 2.0: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="384521475" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/5750" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/5750/hovercard" href="https://github.com/vercel/next.js/issues/5750">#5750</a></p>
<p dir="auto">For now this issue is just a writeup of one issue regarding serverless execution, I don't have a definitive opinion about this yet, but I wanted to write down my thoughts on the subject so that we can get the community involved and work towards a solution <g-emoji class="g-emoji" alias="+1" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png">👍</g-emoji></p>
<h1 dir="auto">Feature request</h1>
<p dir="auto">Support <code class="notranslate">assetPrefix</code> with <code class="notranslate">next/link</code> component.</p>
<h2 dir="auto">Describe the solution you'd like</h2>
<p dir="auto">Provide <code class="notranslate">assetPrefix</code> props for <code class="notranslate">next/link</code> component.</p>
<h2 dir="auto">Additional context</h2>
<p dir="auto">This feature is needed in case we have multiple NextJS apps on the same domain with different <code class="notranslate">assetPrefix</code> .<br>
Note that, even page urls are on the same domain, <code class="notranslate">assetPrefix</code> might be on different CDN host.</p>