-
Notifications
You must be signed in to change notification settings - Fork 23
/
next.config.mjs
158 lines (149 loc) · 5 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import nextMDX from "@next/mdx";
import { remarkPlugins } from "./mdx/remark.mjs";
import { rehypePlugins } from "./mdx/rehype.mjs";
import { recmaPlugins } from "./mdx/recma.mjs";
// All permanent redirects (source -> destination)
const permanentRedirects = [
// Legacy docs
["/docs/functions/testing-functions", "/docs/local-development"],
["/docs/what-is-inngest", "/docs"],
["/docs/reference/functions/retries", "/docs/functions/retries"],
["/docs/creating-an-event-key", "/docs/events/creating-an-event-key"],
["/docs/event-format-and-structure", "/docs/reference/events/send"],
["/docs/events/event-format-and-structure", "/docs/reference/events/send"],
["/docs/writing-and-running-fuctions", "/docs/functions"], //typo
["/docs/cli/steps/", "/docs/guides/multi-step-functions"],
["/docs/events/sources/sdks", "/docs/events"],
["/docs/deploying-fuctions", "/docs/apps/cloud"],
["/docs/deploy", "/docs/apps/cloud"],
["/docs/functions/introduction", "/docs/functions"],
["/docs/how-inngest-works", "/docs"], // TODO/DOCS redirect this to new concepts page
["/docs/frameworks/cloudflare-pages", "/docs/sdk/serve#framework-cloudflare"],
["/docs/frameworks/express", "/docs/sdk/serve#framework-express"],
["/docs/frameworks/nextjs", "/docs/sdk/serve#framework-next-js"],
["/docs/frameworks/redwoodjs", "/docs/sdk/serve#framework-redwood"],
["/docs/sdk/reference/serve", "/docs/reference/serve"],
["/docs/events/webhooks", "/docs/platform/webhooks"],
["/docs/functions/retries", "/docs/reference/typescript/functions/errors"],
["/docs/functions/cancellation", "/docs/guides/cancel-running-functions"],
[
"/docs/reference/python/overview/quick-start",
"/docs/getting-started/python-quick-start",
],
// Other pages
["/uses/zero-infra-llm-ai", "/ai"],
["/uses/internal-tools", "/uses/workflow-engine"],
["/uses/user-journey-automation", "/blog/lifecycle-emails-with-resend"],
// new IA
["/docs/security", "/docs/learn/security"],
["/docs/functions", "/docs/learn/inngest-functions"],
["/docs/functions/multi-step", "/docs/guides/multi-step-functions"],
["/docs/guides/enqueueing-future-jobs", "/docs/guides/delayed-functions"],
["/docs/steps", "/docs/learn/inngest-steps"],
["/blog/banger", "/blog/banger-video-rendering-pipeline"],
[
"/docs/reference/serve#custom-frameworks",
"/docs/learn/serving-inngest-functions#custom-frameworks",
],
["/docs/sdk/serve", "/docs/learn/serving-inngest-functions"],
[
"/docs/getting-started/quick-start/python",
"/docs/getting-started/python-quick-start",
],
["/docs/quick-start", "/docs/getting-started/nextjs-quick-start"],
[
"/docs/reference/typescript/functions/errors",
"/docs/features/inngest-functions/error-retries/inngest-errors",
],
["/docs/reference/middleware/overview", "/docs/features/middleware"],
[
"/docs/reference/middleware/create",
"/docs/features/middleware/create?guide=typescript",
],
[
"/docs/reference/middleware/typescript",
"/docs/features/middleware/dependency-injection?guide=typescript",
],
[
"/docs/reference/python/middleware/encryption",
"/docs/features/middleware/encryption-middleware?guide=python",
],
["/blog/nextjs-openai-o1", "/blog/agentic-workflow-example"],
["/docs/agent-kit/:any*", "https://agentkit.inngest.com"],
];
async function redirects() {
return [
{
source: "/workflow-kit",
destination: "/docs/reference/workflow-kit",
permanent: false,
},
{
source: "/discord",
destination: "https://discord.gg/mPfcyDEdpx",
permanent: true,
},
{
source: "/mailing-list",
destination: "http://eepurl.com/hI3dCr",
permanent: true,
},
{
// From the UI's source editing page:
source: "/docs/event-webhooks",
destination: "/docs/events/webhooks",
permanent: true,
},
{
source: "/features/sdk",
destination: "/docs/sdk/overview",
permanent: true,
},
{
source: "/features/step-functions",
destination: "/docs/guides/multi-step-functions",
permanent: true,
},
...permanentRedirects.map(([source, destination]) => ({
source,
destination,
permanent: true,
})),
{
source: "/library/:path*",
destination: "/patterns",
permanent: true,
},
{
source: "/sign-up",
destination: process.env.NEXT_PUBLIC_SIGNUP_URL,
permanent: true,
},
];
}
const withMDX = nextMDX({
options: {
remarkPlugins,
rehypePlugins,
recmaPlugins,
},
});
/** @type {import('next').NextConfig} */
const nextConfig = {
redirects,
reactStrictMode: true,
pageExtensions: ["js", "jsx", "ts", "tsx", "mdx"],
experimental: {
scrollRestoration: true,
appDir: true,
},
webpack: (config, { dev, isServer }) => {
// Exclude old-style _prefix directories from being rendered (ex. mdx pages)
config.module.rules.push({
test: /_\w+\/.+\.mdx?$/,
use: "ignore-loader",
});
return config;
},
};
export default withMDX(nextConfig);