-
Notifications
You must be signed in to change notification settings - Fork 758
/
Copy pathnext.config.mjs
44 lines (41 loc) · 982 Bytes
/
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
import fs from 'fs';
import remarkGfm from 'remark-gfm';
import rehypePrism from '@mapbox/rehype-prism';
import rehypeSlug from 'rehype-slug';
import nextMdx from '@next/mdx';
const withMdx = nextMdx({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkGfm],
rehypePlugins: [rehypeSlug, rehypePrism],
providerImportSource: '@mdx-js/react',
},
});
const pkg = JSON.parse(
fs.readFileSync('./node_modules/swiper/package.json', 'utf-8')
);
const nextConfig = withMdx({
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
env: {
swiperReleaseVersion: pkg.version,
swiperReleaseDate: pkg.releaseDate,
},
eslint: {
ignoreDuringBuilds: true,
},
async redirects() {
return [
{
source: '/api',
destination: '/swiper-api',
permanent: true,
},
{
source: '/types',
destination: '/types/index.html',
permanent: true,
},
];
},
});
export default nextConfig;