-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.mjs
70 lines (62 loc) · 1.49 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
import nextMDX from '@next/mdx'
import { recmaPlugins } from './src/mdx/recma.mjs'
import { rehypePlugins } from './src/mdx/rehype.mjs'
import { remarkPlugins } from './src/mdx/remark.mjs'
import withSearch from './src/mdx/search.mjs'
const withMDX = nextMDX({
options: {
remarkPlugins,
rehypePlugins,
recmaPlugins,
},
})
/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'],
async rewrites() {
return [
{
source: "/mp/lib.min.js",
destination: "https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js",
},
{
source: "/mp/lib.js",
destination: "https://cdn.mxpnl.com/libs/mixpanel-2-latest.js",
},
{
source: "/mp/decide",
destination: "https://decide.mixpanel.com/decide",
},
{
source: "/mp/:slug",
// use "api-eu.mixpanel.com" if you need to use EU servers
destination: "https://api.mixpanel.com/:slug",
},
];
},
async redirects() {
return [
{
source: '/:path*/index.html',
destination: '/:path*',
permanent: true,
},
{
source: '/:path*.html',
destination: '/:path*',
permanent: true,
},
]
},
async headers() {
return [
{
source: "/giscus-theme.css",
headers: [
{ key: "Access-Control-Allow-Origin", value: "*" },
],
},
]
},
}
export default withSearch(withMDX(nextConfig))