mirror of
https://github.com/zhigang1992/react.git
synced 2026-01-26 08:58:46 +08:00
72 lines
1.4 KiB
JavaScript
72 lines
1.4 KiB
JavaScript
const withMDX = require('@next/mdx')({
|
|
extension: /\.(md|mdx)?$/,
|
|
options: {
|
|
rehypePlugins: [require('@mapbox/rehype-prism')],
|
|
},
|
|
})
|
|
|
|
const nextConfig = {
|
|
target: 'serverless',
|
|
|
|
pageExtensions: ['jsx', 'js', 'mdx', 'md', 'ts', 'tsx'],
|
|
|
|
cssModules: true,
|
|
|
|
cssLoaderOptions: {
|
|
importLoaders: 1,
|
|
localIdentName: '[local]___[hash:base64:5]',
|
|
},
|
|
|
|
env: {
|
|
VERSION: require('./package.json').version,
|
|
},
|
|
|
|
trailingSlash: false,
|
|
|
|
experimental: {
|
|
reactStrictMode: true,
|
|
},
|
|
|
|
async redirects() {
|
|
return [
|
|
{
|
|
source: '/docs/getting-started/:path*',
|
|
permanent: true,
|
|
destination: '/en-us/guide/:path*',
|
|
},
|
|
{
|
|
source: '/en-us/getting-started/:path*',
|
|
permanent: true,
|
|
destination: '/en-us/guide/:path*',
|
|
},
|
|
{
|
|
source: '/zh-cn/getting-started/:path*',
|
|
permanent: true,
|
|
destination: '/zh-cn/guide/:path*',
|
|
},
|
|
{
|
|
source: '/zh-cn',
|
|
permanent: true,
|
|
destination: '/zh-cn/guide/introduction',
|
|
},
|
|
{
|
|
source: '/en-us',
|
|
permanent: true,
|
|
destination: '/en-us/guide/introduction',
|
|
},
|
|
{
|
|
source: '/',
|
|
permanent: true,
|
|
destination: '/en-us',
|
|
},
|
|
{
|
|
source: '/icons',
|
|
permanent: true,
|
|
destination: '/en-us/components/icons',
|
|
},
|
|
]
|
|
},
|
|
}
|
|
|
|
module.exports = withMDX(nextConfig)
|