-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.mjs
64 lines (55 loc) · 1.41 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
import createMDX from "@next/mdx";
import remarkGfm from "remark-gfm";
import rehypeShiki from "rehype-shiki";
const isDev = process.argv.indexOf('dev') !== -1
const isBuild = process.argv.indexOf('build') !== -1
if (!process.env.VELITE_STARTED && (isDev || isBuild)) {
process.env.VELITE_STARTED = '1'
const { build } = await import('velite')
await build({ watch: isDev, clean: !isDev })
}
/** @type {import('next').NextConfig} */
const nextConfig = {
// Configure `pageExtensions` to include MDX files
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
async redirects() {
return [
{
source: "/components",
destination: "/docs/components/button",
permanent: true,
},
{
source: "/docs/components",
destination: "/docs/components/button",
permanent: true,
},
{
source: '/docs',
destination: '/docs/introduction',
permanent: true,
}
];
},
images: {
remotePatterns: [
{
hostname: "images.unsplash.com",
protocol: "https",
},
{
hostname: "img.freepik.com",
protocol: "https",
}
],
},
// Optionally, add any other Next.js config below
};
const withMDX = createMDX({
// Add markdown plugins here, as desired
options: {
remarkPlugins: [remarkGfm],
rehypePlugins: [rehypeShiki],
},
});
export default withMDX(nextConfig);