Files
orca/docs/site/next.config.ts
mirror 34fa2cd5ca
Skill update round trip / roundtrip (false, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, latest) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
source snapshot 2026-09-02
2026-09-02 02:03:16 +08:00

59 lines
1.8 KiB
TypeScript

import { createMDX } from 'fumadocs-mdx/next'
import type { NextConfig } from 'next'
// Keep human-facing animations intact while preventing crawlers from burning
// transfer on multi-MB demo GIFs (serve JPG posters instead).
const crawlerUserAgentPattern =
'.*(?:[Bb][Oo][Tt]|[Cc][Rr][Aa][Ww][Ll]|[Ss][Pp][Ii][Dd][Ee][Rr]|GPTBot|ChatGPT-User|OAI-SearchBot|ClaudeBot|Claude-User|anthropic-ai|PerplexityBot|CCBot|Google-Extended|Applebot|facebookexternalhit|Twitterbot|LinkedInBot|Slackbot|Discordbot|TelegramBot|WhatsApp|SkypeUriPreview|Pinterest|Ahrefs|Semrush|MJ12|DotBot|PetalBot|Bytespider|Amazonbot|DuckDuckBot|Baiduspider|Yandex).*'
const crawlerGifPosterRewrites = [
['/docs/orca-design-mode.gif', '/docs/posters/orca-design-mode.jpg'],
['/docs/tab-split.gif', '/docs/posters/tab-split.jpg']
] as const
const nextConfig: NextConfig = {
// Keep this zone's Next assets separate from the marketing zone.
assetPrefix: '/docs-static',
turbopack: {
root: process.cwd()
},
async rewrites() {
const crawlerUserAgent = [
{
type: 'header' as const,
key: 'user-agent',
value: crawlerUserAgentPattern
}
]
return {
beforeFiles: crawlerGifPosterRewrites.map(([source, destination]) => ({
source,
destination,
has: crawlerUserAgent
}))
}
},
async headers() {
const media = 'public, max-age=2592000, stale-while-revalidate=86400'
return [
{
source: '/docs/:all*(mp4|gif)',
headers: [{ key: 'Cache-Control', value: media }]
},
{
source: '/docs/posters/:path*',
headers: [{ key: 'Cache-Control', value: media }]
},
{
source: '/docs/videos/:path*',
headers: [{ key: 'Cache-Control', value: media }]
}
]
}
}
const withMDX = createMDX()
export default withMDX(nextConfig)