Skip to content

Commit 8a15711

Browse files
authored
Merge pull request #163 from reactjs/sync-1207ee36
Sync with react.dev @ 1207ee3
2 parents 568b959 + b868337 commit 8a15711

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

next.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,35 @@ const nextConfig = {
1212
// TODO: Remove after https://github.com/vercel/next.js/issues/49355 is fixed
1313
appDir: false,
1414
scrollRestoration: true,
15+
<<<<<<< HEAD
1516
legacyBrowsers: false,
17+
=======
18+
reactCompiler: true,
19+
},
20+
async rewrites() {
21+
return {
22+
beforeFiles: [
23+
// Explicit .md extension also serves markdown
24+
{
25+
source: '/:path*.md',
26+
destination: '/api/md/:path*',
27+
},
28+
// Serve markdown when Accept header prefers text/markdown
29+
// Useful for LLM agents - https://www.skeptrune.com/posts/use-the-accept-header-to-serve-markdown-instead-of-html-to-llms/
30+
{
31+
source: '/:path((?!llms\\.txt|api/md).*)',
32+
has: [
33+
{
34+
type: 'header',
35+
key: 'accept',
36+
value: '(.*text/markdown.*)',
37+
},
38+
],
39+
destination: '/api/md/:path*',
40+
},
41+
],
42+
};
43+
>>>>>>> 1207ee36e1c7e3f2737d8f1022015473ffa99adf
1644
},
1745
env: {},
1846
webpack: (config, {dev, isServer, ...options}) => {

0 commit comments

Comments
 (0)