[x] 주로 사용하는 옵션 작성
[ ] 모든 옵션 작성
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,
}
// 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
module.exports = {
distDir: 'build',
}
module.exports = {
env: {
customKey: 'my-value',
},
}