portfolio/next.config.mjs

53 lines
1.2 KiB
JavaScript
Raw Normal View History

2022-12-06 12:54:34 +00:00
import nextMDX from '@next/mdx'
import remarkGfm from 'remark-gfm'
import rehypePrism from '@mapbox/rehype-prism'
/** @type {import('next').NextConfig} */
const nextConfig = {
2023-01-17 21:24:16 +00:00
pageExtensions: ['jsx', 'js', 'tsx', 'ts', 'mdx'],
2023-01-17 21:52:47 +00:00
reactStrictMode: true,
2022-12-06 12:54:34 +00:00
swcMinify: true,
experimental: {
newNextLinkBehavior: true,
2023-01-14 19:31:05 +00:00
scrollRestoration: true
2022-12-06 12:54:34 +00:00
},
images: {
domains: ['i.scdn.co']
},
async rewrites() {
2023-01-17 21:24:16 +00:00
if (process.env.NODE_ENV === 'production') {
return [
{
source: '/api/:path',
destination: 'https://ryanfreeman.dev/:path/',
}
]
} else {
return []
}
},
async headers() {
return [
{
source: '/api/spotify/currently-playing',
headers: [
{
key: "Cache-Control",
value: "s-maxage=1, stale-while-revalidate=59"
}
]
}
]
2022-12-06 12:54:34 +00:00
}
}
const withMDX = nextMDX({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkGfm],
rehypePlugins: [rehypePrism],
2023-01-14 19:31:05 +00:00
}
2022-12-06 12:54:34 +00:00
})
export default withMDX(nextConfig)