appDir

assetPrefix

const isProd = process.env.NODE_ENV === 'production'
 
module.exports = {
  // Use the CDN in production and localhost for development.
  assetPrefix: isProd ? '<https://cdn.mydomain.com>' : undefined,
}

basePath

// next.config.js
module.exports = {
  basePath: '/docs',
}

// Link example
export default function HomePage() {
  return (
    <>
      <Link href="/about">About Page</Link>
    </>
  )
}

// output
<a href="/docs/about">About Page</a>

// Images example
import Image from 'next/image'
 
function Home() {
  return (
    <>
      <h1>My Homepage</h1>
      <Image
        src="/docs/me.png"
        alt="Picture of the author"
        width={500}
        height={500}
      />
      <p>Welcome to my homepage!</p>
    </>
  )
}
 
export default Home

distDir

module.exports = {
  distDir: 'build',
}

env

module.exports = {
	env: {
		customKey: 'my-value',
	},
}