Next.js Discord

Discord Forum

Static Site Deployment

Unanswered
Turkish Angora posted this in #help-forum
Open in Discord
Turkish AngoraOP
I'm preparing to deploy my Next.js app using Azure storage. I didn't need a backend, but decided to go with Next.js for the routing. I have my config output set to 'export', and if I serve it's fine.. but if I just open the .html files from the /out dir, it doesn't work.

4 Replies

Turkish AngoraOP
const nextConfig = {
  output: "export",
  images: {
    unoptimized: true,
  },
  distDir: "out",
  trailingSlash: true,
  assetPrefix: ".",
  staticPageGenerationTimeout: 1000,
  reactStrictMode: false,
};


This will allow the site to work, but images and paths wont route correctly. /index.html will work, but if I navigate to any other paths it will output a blank file.
For anyone coming by this, look at the trailingSlash and assetPrefix config options.