forked from themesberg/flowbite-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
165 lines (162 loc) · 3.73 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
159
160
161
162
163
164
165
import mdx from '@next/mdx';
import slug from 'rehype-slug';
import tableOfContents from 'remark-toc';
import TerserPlugin from 'terser-webpack-plugin';
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
appDir: true,
},
pageExtensions: ['mdx', 'tsx'],
reactStrictMode: true,
webpack(config) {
// Retain React FC display names and anonymous function bodies for docs
config.optimization.minimizer = [
new TerserPlugin({
terserOptions: {
keep_classnames: true,
keep_fnames: true,
mangle: false,
},
}),
];
return config;
},
async redirects() {
return [
{
source: '/alerts',
destination: '/docs/components/alert',
permanent: true,
},
{
source: '/accordion',
destination: '/docs/components/accordion',
permanent: true,
},
{
source: '/avatar',
destination: '/docs/components/avatar',
permanent: true,
},
{
source: '/badges',
destination: '/docs/components/badge',
permanent: true,
},
{
source: '/buttons',
destination: '/docs/components/button',
permanent: true,
},
{
source: '/button-group',
destination: '/docs/components/button-group',
permanent: true,
},
{
source: '/card',
destination: '/docs/components/card',
permanent: true,
},
{
source: '/carousel',
destination: '/docs/components/carousel',
permanent: true,
},
{
source: '/dropdown',
destination: '/docs/components/dropdown',
permanent: true,
},
{
source: '/forms',
destination: '/docs/components/forms',
permanent: true,
},
{
source: '/footer',
destination: '/docs/components/footer',
permanent: true,
},
{
source: '/list-group',
destination: '/docs/components/list-group',
permanent: true,
},
{
source: '/modal',
destination: '/docs/components/modal',
permanent: true,
},
{
source: '/navbars',
destination: '/docs/components/navbar',
permanent: true,
},
{
source: '/pagination',
destination: '/docs/components/paginat',
permanent: true,
},
{
source: '/progress',
destination: '/docs/components/progress',
permanent: true,
},
{
source: '/rating',
destination: '/docs/components/rating',
permanent: true,
},
{
source: '/sidebar',
destination: '/docs/components/sidebar',
permanent: true,
},
{
source: '/spinners',
destination: '/docs/components/spinner',
permanent: true,
},
{
source: '/tables',
destination: '/docs/components/table',
permanent: true,
},
{
source: '/tabs',
destination: '/docs/components/tabs',
permanent: true,
},
{
source: '/timeline',
destination: '/docs/components/timeline',
permanent: true,
},
{
source: '/theme',
destination: '/docs/customize/theme',
permanent: true,
},
{
source: '/toast',
destination: '/docs/components/toast',
permanent: true,
},
{
source: '/tooltips',
destination: '/docs/components/tooltip',
permanent: true,
},
];
},
};
const withMDX = mdx({
extension: /\.mdx?$/,
options: {
rehypePlugins: [slug],
remarkPlugins: [tableOfContents],
},
});
export default withMDX(nextConfig);