-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathnext.config.mjs
51 lines (47 loc) · 1.23 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
// @ts-check
import createNextIntl from 'next-intl/plugin'
import autoImport from 'unplugin-auto-import/webpack'
const withNextIntl = createNextIntl()
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'],
images: {
unoptimized: true,
remotePatterns: [
{
protocol: 'https',
hostname: 'cdn.chengpeiquan.com',
},
],
},
webpack: (config) => {
config.plugins.push(
autoImport({
imports: ['react', { react: ['createContext'] }, 'react-router-dom'],
dts: './src/types/declaration-files/auto-imports.d.ts',
}),
)
return config
},
async redirects() {
const config = {
netease: {
sources: ['/topic/netease/:slug*', '/article/my-netease'],
destination: '/article/my-five-years-working-at-netease',
},
rss: {
sources: ['/feed', '/feed/', '/feed.atom', '/feed.json'],
destination: '/feed.xml',
},
}
return Object.values(config).flatMap(({ sources, destination }) =>
sources.map((source) => ({
source,
destination,
permanent: true,
})),
)
},
}
export default withNextIntl(nextConfig)