mirror of
https://github.com/zhigang1992/react.git
synced 2026-01-24 20:57:51 +08:00
58 lines
1.2 KiB
JavaScript
58 lines
1.2 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,
|
|
},
|
|
|
|
experimental: {
|
|
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',
|
|
},
|
|
{
|
|
source: '/en-us/',
|
|
permanent: true,
|
|
destination: '/en-us',
|
|
},
|
|
]
|
|
},
|
|
},
|
|
}
|
|
|
|
module.exports = withMDX(nextConfig)
|