<p dir="auto">I've been using zeit's <code class="notranslate">ncc</code> to slim down and build our transpiled APIs into tiny, minified, individual scripts that run without any node_modules present on our servers/containers. It's <strong><em>absolutely</em></strong> fantastic.</p>
<p dir="auto">I tried to us ncc w/ NextJS, but probably lack the requisite knowledge of understanding how nextJS builds work, and what is built into the output.</p>
<p dir="auto">My goal: A single, transpiled/built file (or set of files w/ an exposed entrypoint script) that I can run without needing node_modules installed/present on my application servers/containers, which I can simply invoke with a command like:<br>
<code class="notranslate">"NODE_ENV=production node --require 'dotenv/config' ./dist/index.js"</code></p>
<p dir="auto">We use a custom server with our nextJS app, but it's written in vanilla JS, and doesn't require transpilation, webpack, or babel.</p>
<p dir="auto">It does, however, have a handful of dependencies including a redis client and express.</p>
<p dir="auto">I was thinking that maybe the correct thing to do is use ncc for the server, and <code class="notranslate">next build</code> for the client, and then just runn the ncc'ed server file?</p>
<p dir="auto">If someone could point me in the direction of the best resolution, that would sincerely save me days of failed attempts and wasted hours.</p>
<p dir="auto">Thank you!! :)</p>
<p dir="auto">Hi, according to the v3-beta docs, next.js support exporting to static html, and apparently also support "dynamic routes". Was wondering if there was some documentation on how to create dynamic routes when exporting static html.</p>
<blockquote>
<p dir="auto">This is a way to run your Next.js app as a standalone static app without any Node.js server. The export app supports almost every feature of Next.js <strong>including dynamic urls</strong>, prefetching, preloading and dynamic imports.</p>
</blockquote>
<p dir="auto">I've added this to my <code class="notranslate">next.config.js</code> but it doesn't seem to work.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="exportPathMap: () =&gt; {
    return {
      &quot;/&quot;: { page: &quot;/&quot; },
      &quot;/account/:id&quot;: { page: &quot;/account&quot; }
    }
  }"><pre class="notranslate"><code class="notranslate">exportPathMap: () =&gt; {
    return {
      "/": { page: "/" },
      "/account/:id": { page: "/account" }
    }
  }
</code></pre></div>
<p dir="auto">I also tried <code class="notranslate">"/account/*"</code>, but no luck. Any help would be greatly appreciated.</p>

<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>