forked from wundergraph/wundergraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
73 lines (70 loc) · 1.79 KB
/
next.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import withMarkdoc from '@markdoc/next.js';
import { SearchPlugin } from './searchPlugin.mjs';
const production = process.env.NODE_ENV === 'production';
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md'],
async redirects() {
return [
{
source: '/manifesto',
destination: '/introduction',
permanent: false,
},
{
source: '/docs',
destination: '/',
permanent: true,
},
{
source: '/docs/pre-1-0-changes',
destination: '/docs/upgrade-guides',
permanent: true,
},
{
source: '/docs/pre-1-0-changes/:path*',
destination: '/docs/upgrade-guides/:path*',
permanent: true,
},
{
source: '/docs/pre-1-0-changes',
destination: '/docs/upgrade-guides',
permanent: true,
},
{
source: '/docs/deployment/flyio',
destination: '/docs/self-hosted/flyio',
permanent: true,
},
{
source: '/docs/wundergraph-config-ts-reference/configure-wundergraph-application',
destination: '/docs/wundergraph-config-ts-reference',
permanent: true,
},
{
source: '/getting-started',
destination: '/docs/getting-started',
permanent: true,
},
{
source: '/docs/guides/publish-generated-client-to-npm',
destination: '/docs/guides/bundle-generated-client-for-distribution',
permanent: true,
},
{
source: '/docs/tutorials/your-first-wundergraph-application',
destination: '/docs/getting-started/quickstart',
permanent: true,
},
];
},
webpack: (config, options) => {
if (options.nextRuntime !== 'edge' && options.isServer) {
config.plugins ||= [];
config.plugins.push(new SearchPlugin());
}
return config;
},
};
export default withMarkdoc({ mode: production ? 'static' : 'server' })(nextConfig);